Files
wehub-resource-sync d88fd01084
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:09:14 +08:00

1.7 KiB

Step B2 - Dispatch ALL subagents in a single message (Codex)

Codex platform: Uses spawn_agent + wait_agent + close_agent instead of the Agent tool. Requires multi_agent = true under [features] in ~/.codex/config.toml. If spawn_agent is unavailable, tell the user to add that config and restart Codex.

Call spawn_agent once per chunk — ALL in the same response so they run in parallel. Build the message by wrapping the extraction prompt in task-delegation framing:

spawn_agent(agent_type="worker", message="Your task is to perform the following. Follow the instructions below exactly.\n\n<agent-instructions>\n[extraction prompt, with FILE_LIST, CHUNK_NUM, TOTAL_CHUNKS, DEEP_MODE substituted]\n</agent-instructions>\n\nExecute this now. Output ONLY the structured JSON response.")

After all agents are dispatched, collect results sequentially in memory:

result = wait_agent(handle); close_agent(handle)   # repeat per handle

Parse each result as JSON. Accumulate nodes/edges/hyperedges across all results and write to graphify-out/.graphify_semantic_new.json. Codex collects in memory, so there are no per-chunk files on disk; the disk-based success checks in Step B3 do not apply — a chunk that returns invalid JSON is the failure signal instead.

Subagent prompt template:

See references/extraction-spec.md for the compact subagent prompt (rules, node-ID format, confidence rubric, hyperedge and vision rules, JSON schema). Load it only here, only when at least one chunk holds a doc, paper, or image; a pure-code corpus has skipped Part B and never reads it. Pass each agent that prompt verbatim with FILE_LIST, CHUNK_NUM, TOTAL_CHUNKS, and DEEP_MODE substituted, and have it return the JSON inline.