[argus] patch #41: coerce stringified write_todos arg (planner pipeline)#7
Merged
Merged
Conversation
…er pipeline) glm-nw sometimes double-encodes the write_todos tool argument: args.todos arrives as the JSON string of a valid list. Pydantic rejects it, the agent gets an error ToolMessage, and state.todos never hydrates - caught by the first weekly eval (2026-07-02, pythia/planning on glm-planner). ArgusTodoMiddleware.after_model now parses a string arg in place (only when it json-parses to a list) before tool validation, so the trajectory records the normalized call and the eval graders stay strict. Unparseable strings keep the normal validation-error path. The sibling flake (plan.json written but write_todos never called) is model behavior the weekly baseline tracks, not patched. Also refreshes the module docstring's stale agent-selection note (qwen-local-coder -> the bytedance#18 uses_planner_pipeline gate). Tests: test_argus_todo_middleware.py 12 passed (+3 new). PATCHES.md bytedance#41 in the same commit (ledger hard rule). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First real catch from the weekly eval (2026-07-02): pythia/planning scored 2/4 on glm-planner because the model double-encodes the
write_todosargument —args.todosarrives as the JSON string of a valid list, pydantic rejects it (todos: list[Todo]), andstate.todos[]never hydrates.ArgusTodoMiddleware.after_model(argus-owned file, zero upstream carry) now parses a string arg in place when it json-parses to a list, before tool validation. The trajectory records the normalized call, so the eval grader stays strict. Strings that don't parse to a list keep the normal validation-error path.Deliberately NOT patched: the sibling flake where plan.json is written but
write_todosis never called — that's model behavior for the weekly baseline to track, not something to paper over in middleware.Validation
test_argus_todo_middleware.py: 12 passed (3 new: coercion happy path, unparseable-string left alone, native-list/other-tools untouched).I001in the test file's import block is pre-existing at HEAD (my change only appends).After merge
Pin bump +
make deerflow-canary/make deerflow-promoteas usual; next Sunday's weekly eval should show pythia/planning improve (the str-arg half of the 2/4; the never-called half remains tracked).🤖 Generated with Claude Code