fix(tasks): wire parent_task_id lineage end-to-end on the HTTP path (closes #111)#121
Open
umi-appcoder[bot] wants to merge 1 commit into
Open
fix(tasks): wire parent_task_id lineage end-to-end on the HTTP path (closes #111)#121umi-appcoder[bot] wants to merge 1 commit into
umi-appcoder[bot] wants to merge 1 commit into
Conversation
…111) create_task accepted parent_task_id and recorded it on the child + init'd sub_task_ids=[], but nothing appended the child to the *parent's* sub_task_ids, and handle_claude_create_task dropped parent_task_id from the request body — so API-created sub-agent lineage was always empty and the list-by-parent / Subagents tab were effectively dead for HTTP-created tasks. - handle_claude_create_task now threads parent_task_id from the body to create_task. - create_task appends the child to the parent via a new _append_sub_task_id helper that uses the meta-file lock (_atomic_update_meta) so concurrent creates can't clobber the list; it's best-effort and a no-op when there's no parent or the parent is gone. Mirrors mcp_agent_orchestrator._append_sub_task_id. Tests (tests/task_lineage_test.py, 5): child records parent + parent lists child, multiple-children append + dedupe, no-parent no-op, missing/empty parent safe, list_tasks(parent=...) filter. Full suite 471, OK. Closes #111 Co-Authored-By: Claude Opus 4.8 (1M context) <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
Threads
parent_task_idthrough the HTTP create path and records the child on its parent, so API-created sub-agent lineage actually populates. Closes #111 — PR 3 of the reliability-hardening series (good-first).The bug
create_taskacceptedparent_task_idand set it on the child + init'dsub_task_ids=[], but nothing appended the child to the parent'ssub_task_ids, andhandle_claude_create_taskdroppedparent_task_idfrom the request body. So lineage was always empty and the Subagents tab / list-by-parent were dead for HTTP-created tasks (only the MCP orchestrator populated lineage, via its own path).Fix
handle_claude_create_taskpassesparent_task_idfrom the body tocreate_task.create_taskappends the child to the parent via a new_append_sub_task_idhelper using the meta-file lock (_atomic_update_meta) so concurrent creates can't clobber the list; best-effort, no-op when there's no parent or the parent is gone. Mirrorsmcp_agent_orchestrator._append_sub_task_id.Tests
tests/task_lineage_test.py(5): child↔parent linkage, multi-child append + dedupe, no-parent no-op, missing/empty parent safe,list_tasks(parent=...)filter. Full suite 471, OK.Closes #111
🤖 Generated with Claude Code