Conversation
Project a qwen subagent delegation into the Claude-Code on-disk shapes so hub-agent's existing readers (_scan_agent_entry / _resolve_subagent) surface the picker row + drill-in transcript with NO reader change (the XERK-304 contract), and the usage/archive/migration walks count + carry the delegated tokens unchanged. Qwen's delegation is a near-Claude Agent launch, so this RESHAPES rather than synthesizes (the dsh [J] difference): - qwen_transcript.py: map the "agent" tool to "Agent", and reshape qwen's task_execution tool_result into Claude's async_launched toolUseResult + an "agentId:" result text. The STOP edge is free: qwen already writes an exact <task-notification>. A foreground/completed subagent stays resolvable but is never a live row (no notification would retire it). - qwen_session.py: the tail projects each child's own native log (<slug>/subagents/<parent>/agent-<id>.jsonl) into the Claude subagents/ layout, incrementally per child. _pump now runs child sync every pump past the parent's no-new-data early return (a background subagent grows its log while the parent turn is idle -- the qwen difference from dsh). Verified through hub-agent's REAL readers over a corpus CAPTURED from a real Qwen 0.22.x background delegation on disk (no-mock). Workflows are a stated residual gap (no Claude-shaped on-disk mapping captured); live end-to-end delegation is host-proof, the footing every qwen child ships on. Docs: new .claude/rules/qwen-delegation.md (scoped), [Qwen J] pointer in qwen.md.
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.
Summary
Projects a Qwen session's subagent lifecycle into Claude-Code on-disk JSONL shapes so
_scan_agent_entry,_resolve_subagent,_resolve_workflow_run,_workflow_agentsand theusage/archive/migration walks read it with NO reader change (the XERK-304 contract).
qwen_transcript.py:_subagent_launch()detects a Qwenagent-tool launch and reshapesbackground →
toolUseResult{status:"async_launched"}+ clean agentId text; foreground →prepended
agentId:line (resolvable but no live row, preventing phantom). Grammar-checksevery agentId against
_VALID_AGENT_ID_REbefore use.qwen_session.py:_pumpsplit into_pump_parent()+ always-running_sync_children().Child logs projected incrementally through fresh
QwenProjectorinstances into the Claudesubagents/layout. Symlinked child logs refused.QA verdict
PASS — adversarial QA agent confirmed all claims:
each caught by the relevant test
Test plan
pytest agent/tests/test_qwen_transcript.py agent/tests/test_qwen_session.py -v(61 pass)node --test agent/tests/tunnel-agent.test.js(114 pass)