Skip to content

SessionStart subagent dispatch card and spawn-ready role args (0.2.39) - #246

Merged
lidge-jun merged 10 commits into
devfrom
codex/subagent-dispatch-card
Sep 24, 2026
Merged

lidge-jun merged 10 commits into
devfrom
codex/subagent-dispatch-card

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Implements #243 and prepares codexclaw 0.2.39.

Agents on the V1 collab family spent several exec cells per session rediscovering the nested tools.multi_agent_v1__spawn_agent callable and the routed model id before they could spawn a subagent. SessionStart now injects a dispatch card, even when no role has a fallback. SessionStart carries no tool catalog, so the card does not claim a family it cannot see.

  • It gives one Code Mode cell that finds the unique spawn_agent helper, identifies V1 or V2 from companion tools, and spawns: V1 with message/model/reasoning_effort, V2 with task_name and fork_turns: "none" so model overrides are accepted. It throws before any call if the helper or the family is ambiguous.
  • CODEXCLAW_SPAWN_V1=1 prints the exact tools.multi_agent_v1__* calls, labeled an override rather than host evidence.
  • A dated alias map (deepseek, swe2, kimi, sol, luna) is marked verified or unverified against the local Codex catalog, so the hook stays local and fast (36-41 ms measured). Full model ids pass through unchanged.

subagents_get adds spawnArgs per role and staleModel (true, false or null plus staleReason) from a catalog read bounded to 5 s. It reports null instead of guessing from a stale cache. The MCP stdio server now handles requests in order and finishes queued replies at EOF; without that, the new async read dropped replies.

Validation: npm test 3,604/3,609 locally (0 failed, 5 skipped), plus the gate, inventory and check-versions 0.2.39. The card's cell, pasted verbatim into this V1 Code Mode session, spawned the DeepSeek alias in one cell twice. V2 is covered only by a tool harness. The plan, audits and evidence are in devlog/_plan/260924_issue_sweep_0238/060-071.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T08:37:01.587069Z b7846dc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7846dcb8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const v1 = has(/(send_input|close_agent|resume_agent)$/), v2 = has(/(followup_task|interrupt_agent|list_agents)$/);
if (v1 === v2) throw new Error("collab family unresolved: v1=" + v1 + " v2=" + v2);
const a = {message:"Report your model and say OK; do not edit files.",model:"command-code/deepseek-deepseek-v4.1-flash",reasoning_effort:"low"};
text(await tools[s[0]](v1 ? a : {...a, task_name:"model_probe", fork_turns:"none"}));`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Omit unsupported model fields from the V2 spawn call

On V2 hosts using the current collaboration.spawn_agent schema, this branch spreads a into the request and therefore sends model and reasoning_effort, even though V2 accepts task_name, message, and fork_turns but not those V1-only fields. Input validation rejects the card's advertised first-cell call before creating an agent; the new test misses this because its mock accepts arbitrary argument objects.

Useful? React with 👍 / 👎.

@lidge-jun
lidge-jun merged commit 22ea08c into dev Sep 24, 2026
14 checks passed
@lidge-jun
lidge-jun deleted the codex/subagent-dispatch-card branch September 24, 2026 08:41
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 66 / 80

이 PR은 세션이 시작될 때마다 서브에이전트를 부르는 짧은 안내 카드를 붙입니다. 예전에는 역할에 예비 모델이 있을 때만 안내가 나왔습니다. 이제는 예비 모델이 없어도 카드가 나옵니다. 버전은 0.2.39이고, 기준 브랜치는 dev입니다.

카드는 두 장입니다. 환경 변수 CODEXCLAW_SPAWN_V1=1이면 V1 호출 예시를 그대로 보여 줍니다. 카드 첫 줄은 이 값을 덮어쓰기라고 부릅니다. 그 값이 없으면, 도구 이름에서 spawn_agent가 정확히 하나인지 찾고, 옆에 있는 도구로 V1인지 V2인지 가른 다음, 그 자리에서 한 번 호출합니다. 도구가 없거나 두 가족 신호가 겹치면 호출하지 않고 멈춥니다.

같이 붙는 별칭 표는 deepseek, swe2, kimi, sol, luna를 실제 모델 이름으로 바꿉니다. 이 컴퓨터의 Codex 목록에 있으면 verified, 없으면 unverified입니다. 전체 모델 이름은 바꾸지 않고 그대로 둡니다.

subagents_get은 역할마다 바로 넣을 수 있는 spawnArgs와, 그 모델이 목록에 없는지를 staleModel로 돌려줍니다. 목록을 5초 안에 못 읽으면 없다고 단정하지 않고 null을 줍니다. MCP 서버는 요청을 한 줄씩 순서대로 처리하고, 입력이 끝나도 기다리던 답을 보낸 뒤에 종료합니다.

plugins/codexclaw/components/subagent-config/src/dispatch-card.ts:34 - V2로 보면 model과 reasoning_effort를 호출에 그대로 넣습니다. 새 테스트는 아무 객체나 받아 주는 가짜 함수라서, 실제 V2 도구가 그 칸을 거절해도 통과합니다. PR 설명도 V2는 도구 하니스만 확인했다고 적습니다. Codex 인라인 코멘트는 지금 collaboration.spawn_agent가 task_name, message, fork_turns만 받고 그 두 칸은 거절한다고 합니다. 같은 저장소 delegation.md는 fork_turns가 "none"이면 모델 덮어쓰기가 된다고 적습니다. 둘 다 이 코드만으로는 확인이 안 됩니다. 거절하는 쪽이 맞으면, 안내 카드의 첫 호출이 V2에서 바로 실패합니다.

plugins/codexclaw/components/subagent-config/src/dispatch-card.ts:33 - 실행 예제의 모델은 항상 deepseek입니다. 안내 문장은 검사 문장만 바꾸라고 합니다. 그대로 따르면 역할에 정해 둔 모델이나 다른 별칭을 쓰지 않습니다. 카드는 subagents_get의 spawnArgs를 가리키지도 않습니다.

메인테이너의 판단이 필요한 지점

V2 첫 호출에서 model과 reasoning_effort를 뺄지, 실제 V2 호스트에서 한 번 호출해 보고 남길지 정해야 합니다. 가족 판별은 send_message를 보지 않습니다. delegation.md는 그것을 V2 신호로 적습니다. send_message만 있고 followup_task 같은 도구가 없으면 카드는 가족을 못 찾고 호출하지 않습니다. 로컬 목록 파일이 하루보다 오래되면 staleReason이 catalog unavailable입니다. 파일이 없을 때와 같은 문장입니다.

너의 추천

V1 카드와 MCP가 답을 순서대로 보내는 수정은 이 릴리스에 넣어도 됩니다. V2 예제 인자만 실제 스키마에 맞춘 뒤에 0.2.39로 머지하세요. 그 전에는 카드가 V2에서 첫 호출에 거절될 수 있습니다.

이 댓글은 grok-bot이 작성했습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant