薪尽火传 · Agent Relay
Switch agents without losing context. Memory Hub is the internal storage layer; Relay is the product layer.
Mandatory First Step
After triggering this Skill, first read the Relay Context. Do not scan the project directory, Skill files, or Home directory first:
- Prefer calling the MCP tool
relay_contextwith the current project path and current Agent name. - If MCP is not available, run
agent-relay context --agent <name> --project "$PWD". - Only after the Context points to specific artifacts should you open those artifacts for on-site verification.
Do not replace the Relay Context with find /, full directory scans, or raw session logs.
Action Selection
| User Intent | Action |
|---|---|
| "Continue", "Go on", "See what other agents did" | context or resume --no-mark, check inbox |
| "Hand off to Codex/Claude/TRAE" | offer |
| Take the baton and start working | accept |
| Long-running task still in progress | heartbeat |
| Completed with evidence | complete |
| Handoff party confirms completion | verify |
| Cannot continue | fail or reject |
| Cancel the relay | cancel |
| General stage recording | capture |
Use the agent-relay command; the old memory-hub is only a compatibility entry point.
Taking the Baton
- Read the current project and the queue of pending handoffs.
- Open the real artifacts referenced by the handing-off agent.
- If artifacts are missing or have changed, do not accept the baton directly; first explain the discrepancy.
- Once confirmed actionable,
accept. - Do not ask the user to repeat background that is already recorded in the Hub.
agent-relay context --agent codex --project "$PWD"
agent-relay inbox --agent codex --project "$PWD"
agent-relay accept \
--relay relay-xxxx \
--agent codex \
--summary "Input artifacts verified, starting to take the baton"
In a read-only sandbox, first run:
agent-relay resume --agent codex --project "$PWD" --no-mark
Handing Off
A handoff must include clear acceptance criteria. Provide real artifact paths or verifiable sources; do not just write "done."
agent-relay offer \
--project "$PWD" \
--from-agent trae \
--to-agent codex \
--summary "Implementation complete, handing off to Codex for edge-case validation" \
--acceptance "All tests pass" \
--acceptance "No sensitive information present" \
--artifact "/path/to/implementation" \
--source-ref "test: integration suite passed" \
--priority high
By default, an offer expires if not accepted within 7 days; the default lease after acceptance is 1 hour. For long-running tasks, periodically renew the lease:
agent-relay heartbeat \
--relay relay-xxxx \
--agent codex \
--summary "Edge-case testing in progress"
Completion and Verification
Upon completion, the accepting agent must provide evidence:
agent-relay complete \
--relay relay-xxxx \
--agent codex \
--summary "Edge-case verification completed" \
--artifact "/path/to/test-results.json"
The verifying agent confirms each criterion and checks the artifacts:
agent-relay verify \
--relay relay-xxxx \
--agent trae \
--summary "Artifacts and acceptance criteria both confirmed" \
--accept-all-criteria
completed is not yet closed loop; only verified counts as a completed baton leg.
Recording Boundaries
- Do not save entire chat logs, passwords, tokens, API keys, or unfiltered private data.
- Do not write guesses as facts; do not modify past events — append corrective records.
- Do not write Relay entries for single-agent, single-turn, or tasks with no future value.
- Relay does not replace Git, business version control, or file locks for simultaneous multi-user editing.
- Real-environment verification takes precedence over memory content.
See references/protocol.md for the full state machine, dependency chain, artifact fingerprints, conflict resolution, and privacy rules.