fix(agents): harden update_agent null-like args#2945
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the custom agent self-update flow so null-like string placeholders are treated as omitted optional fields and tool errors are surfaced more clearly.
Changes:
- Adds explicit
UpdateAgentArgsschema with null-like normalization. - Marks
update_agenterror responses as errorToolMessages. - Updates the self-update prompt and tests for null-like placeholder handling.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
backend/packages/harness/deerflow/tools/builtins/update_agent_tool.py |
Adds argument schema, null-like normalization, and error ToolMessage status. |
backend/packages/harness/deerflow/agents/lead_agent/prompt.py |
Clarifies that agents should omit unchanged fields instead of passing null-like strings. |
backend/tests/test_update_agent_tool.py |
Adds regression coverage for null-like field handling and error status. |
backend/tests/test_lead_agent_prompt.py |
Verifies the self-update prompt includes null-like string guidance. |
|
@Eilen6316, thanks for your contribution. Please take a look at the lint and unit test error. |
3bb4b23 to
4567e1f
Compare
Thanks for the review. I fixed both issues: the e2e failure was caused by the custom args_schema breaking ToolRuntime injection, so I switched to parameter-level BeforeValidator instead. |
|
@Eilen6316, thanks for your contribution. Here are some suggestions for code
|
4567e1f to
7eb9b0e
Compare
|
Thanks for the review. I updated the PR accordingly.
|
|
Update: this PR has been rebased onto the latest |
Summary
Tests
Closes #2906