Skip to content

fix(dashboard): accept plain dict in agent_run for V2 executions - #32

Open
petarkrvavac wants to merge 1 commit into
JailbrokenAI:mainfrom
petarkrvavac:fix/v2-agent-run-dict
Open

fix(dashboard): accept plain dict in agent_run for V2 executions#32
petarkrvavac wants to merge 1 commit into
JailbrokenAI:mainfrom
petarkrvavac:fix/v2-agent-run-dict

Conversation

@petarkrvavac

Copy link
Copy Markdown

Problem

Starting an autonomous agent run from the V2 dashboard failed immediately with:
AttributeError: 'dict' object has no attribute 'model_dump'
The direct POST /api/agent/run route worked, but V2 executions failed before the first agent round.

Root cause

agent_run() assumed that body was always a Pydantic AgentRunRequest and unconditionally called:
body.model_dump(exclude_defaults=True)
That is true for the direct FastAPI route, where the request body is validated into AgentRunRequest.
The V2 execution engine uses a different path: _agent_execution() calls agent_run(args) with a plain dict, which does not provide .model_dump().

Fix

Normalize the body at the start of agent_run():

  • use model_dump(exclude_defaults=True) when available
  • otherwise copy the plain dict
    This keeps the direct route behavior unchanged while allowing V2 executions to use the same handler safely.

Verification

  • Direct POST /api/agent/run behavior remains unchanged
  • V2 autonomous runs no longer fail on model_dump()
  • python -m py_compile wallbreaker/dashboard/server.py succeeds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant