You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[S3] Agent.get() hydration papercuts: llm_id TypeError, null-budget RuntimeWarning, execution_config clobbered, max_iterations dropped on save #1124
Source: external black-box user audit of PyPI aixplain 0.2.48 (findings #6 minors and 'additional minor issues'). Verified offline against development @ e9f7061; the aixplain/ package there is byte-identical to main/0.2.48, so this is present on all branches.
Problems (all reproduced offline against development)
agent.llm_id raises TypeError after Agent.get() because llm comes back as a {id, name} dict (_decode_role_ref, aixplain/v2/agent.py:157-196) and llm_id accepts only str/Model (:2061-2067).
Every Agent.get() prints RuntimeWarning: 'NoneType' ... non-optional type budget when the response has budget: null; field is typed non-Optional at agent.py:704.
Session.execution_config is None after save(): _create copies every non-excluded field from the POST response (resource.py:571-583) and overwrites the local value when the response omits executionConfig. ExecutionConfig.to_dict() also omits budget (session.py:361, exclude=lambda v: True) even though the budget reaches the backend via to_api_dict(), which is confusing when inspecting.
agent.max_iterations = 1 after construction is silently dropped on save(): build_save_payload pops maxIterations and the fold into budget.maxIterations only runs in __post_init__, so the PUT carries budget=None. (Constructor path folds correctly with a DeprecationWarning; not a bug.)
Suggested fixes
Handle dict in llm_id (self.llm["id"]); type budget: Optional[Budget] or pop null in _agent_from_dict (agent.py:2657); skip keys the server omitted when hydrating from a create response; fold max_iterations in build_save_payload or raise; emit budget in ExecutionConfig.to_dict(). Also consider Agent.Budget = Budget alias like Agent.Task (audit claimed Budget is missing from the public surface; it is exported from aixplain.v2, just not reachable as aix.Budget).
Activity