Fix: team_task_list emits null for description/owner, hanging calling agents (#390)#391
Open
crystallyf1 wants to merge 2 commits into
Open
Fix: team_task_list emits null for description/owner, hanging calling agents (#390)#391crystallyf1 wants to merge 2 commits into
crystallyf1 wants to merge 2 commits into
Conversation
…eAI#390) `exec_task_list` built its per-task JSON with `json!({ ... "description": t.description, "owner": t.owner ... })`. When these optional fields were `None`, serde rendered them as a bare JSON `null`. Some MCP clients (Gemini/ACP) hang on `null` tool-result fields, which froze the calling agent and crashed spawned sub-agents (issue iOfficeAI#390). Map `None` to an empty string via `.clone().unwrap_or_default()`, mirroring the existing `unwrap_or(Idle)` guard in `exec_members`. The output shape stays a string for those fields, so clients never receive `null`. Add a regression test (`exec_task_list_emits_empty_string_not_null_for_missing_fields`) that replicates the per-task mapping against a `TeamTask` with `description: None, owner: None` and asserts the serialized JSON contains `"description":""`/`"owner":""` and never `"description":null`/`"owner":null`. The test fails against the pre-fix mapping and passes after the fix. Closes iOfficeAI#390
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.
Problem
team_task_list(exec_task_listincrates/aionui-team/src/mcp/server.rs) builds its per-task JSON result withjson!({ ..., "description": t.description, "owner": t.owner, ... }).TeamTask::descriptionandTeamTask::ownerareOption<String>, so when a task has no description or owner the fields serialize to a bare JSONnull.Some MCP clients (Gemini / ACP) hang when a tool result contains
nullfor these fields. In practice this freezes the calling agent and crashes spawned sub-agents the moment they callteam_task_liston a board that has any task without a description/owner (which is the common case). Tracked in #390.Fix
Map
Noneto an empty string via.clone().unwrap_or_default(), so the fields are always emitted as strings ("") and clients never receivenull. This mirrors the existing guard inexec_members, which already normalizes a missing agent status withunwrap_or(TeammateStatus::Idle)for the same reason.Test
Adds a regression test
exec_task_list_emits_empty_string_not_null_for_missing_fieldsin the existingmod tests. It replicatesexec_task_list's per-taskjson!mapping against aTeamTaskwithdescription: None, owner: Noneand asserts the serialized JSON:"description":""and"owner":"""description":nullor"owner":nullThe test fails against the pre-fix mapping (serialized output was
"description":null,...,"owner":null) and passes after the fix. Fullcargo test -p aionui-team --libis green (327 passed).Closes #390