fix(agent-manager): decode JSON-encoded task arrays - #13608
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by grok-4.6 · Input: 170K · Output: 16K · Cached: 406.4K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 31, 2026 12:54
kirillk
approved these changes
Aug 31, 2026
This was referenced Aug 31, 2026
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 Problem This Solves
Agent Manager rejects a start request when a model returns
tasksas a JSON-encoded array instead of an array. The outer tool arguments parse successfully, but CLI validation rejects the nested string before permission checks or the extension start event, so no session is created.Fixes #13596.
Why This Change Was Made
The advertised schema already correctly describes
tasksas array-or-null. Provider adapters parse the outer arguments but do not decode nested JSON strings. Changing the advertised schema would encourage the incorrect format and could disturb the existing flat, nullable schema used for provider compatibility.Decode one JSON layer only for the runtime start operation, then validate the result with the existing task schema and 1–20 item bounds. Keep native arrays, management actions, permission checks, and the extension event contract unchanged. Malformed JSON, decoded non-arrays, double-encoded strings, invalid task objects, empty arrays, and oversized arrays still fail before permission or event publication.
This is a defensive compatibility fix. It does not establish that MiMo generated the reported payload or that an SDK change caused the reported version regression.
User Impact
Local and worktree session requests can proceed when the task list is otherwise valid but JSON-encoded. Models still receive the array-based schema, and genuinely invalid task lists remain rejected. A patch changeset is included.
Evidence
vscode-self-testused a credential-free scripted OpenAI-compatible provider and the real extension/backend flow. Before the fix, encoded tasks failed. After the fix, the same payload created a session; native arrays still created sessions; invalid encoded tasks created none. The captured advertised task schema was identical before and after. The isolated test processes were stopped afterward.Before, the encoded task array is rejected:
After, the same encoded task array succeeds and the extension creates a session: