Maintain Mixagents
The repository contains two independent integrations and the provider-neutral
Broker project. Select the affected package first and keep its lifecycle,
distribution surface, and evidence separate from the others. Do not introduce
a shared abstraction merely because packages involve agents, providers, or
similar transports.
MixAgents Broker
Read the Broker product and status owner,
its accepted
backend and lifecycle policy,
its accepted
controller contract,
its local project instructions, and its
security owner before changing routing,
worker lifecycle, provider data, credentials, permissions, tools, or paid-call
behavior.
Broker exists to schedule workers across model providers without globally
switching the controller's provider. Preserve that parent outcome rather than
reducing the package to a DeepSeek-specific adapter or a one-shot model tool.
Keep these boundaries explicit:
- Name the effective controller, provider, model, backend, worker identity, and
lifecycle owner truthfully.
- A backend owns only the lifecycle semantics it can actually provide. Never
present an externally managed worker as a native Codex child.
- Provider selection does not grant tool, filesystem, network, or mutation
authority. The effective harness and environment own those permissions and
side effects.
- Missing capability, credentials, or transport fails closed. Never silently
change provider, model, backend, or task carrier.
- Prefer native Codex children only when the full cross-provider capability
contract passes; otherwise select the qualified App Server fallback before
dispatch. Never migrate a live Agent as an implicit retry.
- Route from a versioned qualification record. Do not trial-spawn a native
child per Agent; requalify only when the Codex build, plugin, route, credential
identity, environment, permissions, or relevant protocol changes. Start with
offline checks, and require explicit authorization for a live canary.
- Promote a fully evidenced qualification atomically for new Agents only. Demote
the affected key on a provider, transport, identity, or lifecycle contract
violation, not an ordinary task failure. Reuse the same creation through App
Server only after proving native accepted no child and began no external
effect; ambiguity must not create a second worker.
- Preserve the native-sized Agent thread contract:
routes, spawn_agent,
send, wait_agent, interrupt_agent, and list_agents; a small status
vocabulary; and final text or an error. Do not reintroduce a generic Job,
revision, pending-action, cancellation, artifact, or release protocol without
a demonstrated consumer that App Server threads cannot serve.
- Completion, failure, and interruption end the current turn, not the Agent
thread. Follow-up input may start another turn on the same App Server thread.
- App Server owns managed thread history, turn results, and recovery. Persist
only non-secret runtime metadata that cannot be reconstructed from it.
- Scope runtime processes by route and effective access. The
$broker Skill
routes qualified native Agents through Codex collaboration tools directly;
the local STDIO MCP server owns App Server-backed Agents.
- MCP tools accept only preconfigured routes, never inline credentials,
endpoints, headers, or provider definitions.
- Send only the complete assignment and context explicitly selected for the
worker. Managed workers use the supplied checkout directly; the controller
serializes overlapping writers or prepares a Codex worktree before dispatch.
- Relay transient non-secret approval or user-input requests through the host
only when it advertises elicitation during an associated call. Otherwise
decline explicitly; never collect credentials or expand route authority.
- Treat App Server
turn/interrupt as a local turn result. State the provider
compute/billing limitation instead of inventing a remote-cancellation claim.
- Treat probes as disposable evidence; record only decision-grade results in
their durable project owner.
The existing Codex DeepSeek package is inherited evidence, not a Broker runtime
dependency. Pi DSH mimic remains a separate first-request integration.
Codex DeepSeek subagent
Read the composition and transport design
before changing provider routing, child creation, Hook transport, authentication,
or installed files. Read the security owner
when a change affects credentials, plaintext state, permissions, or provider
data. The runtime skill
is the parent Agent's installed consumer contract; update it only when that
observable contract changes.
Keep these ownership boundaries intact:
hooks/plaintext_handoff.py and hooks/plaintext-handoff.ps1 implement the
same one-shot envelope and state transitions on different platforms.
agents/, the Hook examples, snippets/AGENTS.md, and
prompts/install-with-codex.md jointly define what installation distributes
and wires into Codex.
- Codex continues to own child identity, permissions, cancellation, waiting,
and callback. This package owns only the temporary cross-provider assignment
transport.
Preserve stage-before-spawn, the exact v4_flash_worker role,
fork_turns="none", atomic at-most-once delivery, and explicit handling of
pending, claimed, expired, locked, or quarantined state. A transport failure
must not silently switch provider, model, collaboration mode, or task carrier.
Changes to this contract normally propagate across both platform scripts, the
installer and Hook templates, the runtime skill, and their focused tests.
Pi DSH mimic
Read the request and experiment design
before changing activation, bootstrap payloads, tools, or stage transitions.
Read the security owner when a
change affects provider data or filesystem authority.
Use the existing code owners:
src/session-stage.ts owns route activation and durable stage restoration.
src/protocol.ts owns the Minimal first-request shape and later persona
preservation.
src/index.ts maps those rules onto Pi events; src/editor.ts owns the
contributed str_replace_editor behavior.
The user's real task must occupy request one without a synthetic model round.
Arm only a new session whose model id contains deepseek-v4-pro; do not forge a
bootstrap after a conversation has started. Provider errors and aborted
responses retain the bootstrap, while a successful assistant response or real
tool call promotes the session. After promotion, Pi again owns the native
payload and full tool catalog while the Minimal persona remains. Preserve
resume and crash-stale recovery, non-target isolation, image-bearing tasks, and
the editor's explicit filesystem boundary.
Evidence and delivery
Choose checks from the behavior actually changed:
- Broker plugin, Skill, and App Server adapter:
npm --prefix packages/broker run check,
npm --prefix packages/broker run pack:check, plugin validation, Skill
validation, local Markdown links, and final diff inspection. These tests use
a fake App Server; a separate loopback-provider probe may exercise the real
bundled Codex without contacting a provider.
- Codex templates and distribution links:
python3 packages/codex-deepseek-subagent/tests/test_agent_templates.py
- POSIX handoff protocol:
python3 packages/codex-deepseek-subagent/tests/test_plaintext_handoff.py
- Windows handoff protocol, on Windows:
powershell -NoProfile -File packages/codex-deepseek-subagent/tests/plaintext-handoff.windows.ps1
- Pi extension behavior and package contents:
npm --prefix packages/pi-dsh-mimic run check and
npm --prefix packages/pi-dsh-mimic run pack:check
These local checks make no provider call. Run a Broker provider qualification,
a DeepSeek smoke test, or a Project2 experiment only with explicit
authorization for its cost and external data boundary. Keep completion claims
backend-, platform-, provider-, and evidence-specific, and update the affected
English and Chinese public owners when observable behavior or safety guidance
changes.
1---2name: maintain-mixagents3description: Maintain or diagnose mixagents package contracts in Broker, codex-deepseek-subagent, or pi-dsh-mimic, including cross-provider routing, worker lifecycle, plaintext handoff, first-request payloads, and session stages. Skip unrelated repository work.4---56# Maintain Mixagents78The repository contains two independent integrations and the provider-neutral9Broker project. Select the affected package first and keep its lifecycle,10distribution surface, and evidence separate from the others. Do not introduce11a shared abstraction merely because packages involve agents, providers, or12similar transports.1314## MixAgents Broker1516Read the Broker [product and status owner](../../../packages/broker/README.md),17its accepted18[backend and lifecycle policy](../../../packages/broker/docs/backend-and-lifecycle-policy.md),19its accepted20[controller contract](../../../packages/broker/docs/controller-contract.md),21its [local project instructions](../../../packages/broker/AGENTS.md), and its22[security owner](../../../packages/broker/SECURITY.md) before changing routing,23worker lifecycle, provider data, credentials, permissions, tools, or paid-call24behavior.2526Broker exists to schedule workers across model providers without globally27switching the controller's provider. Preserve that parent outcome rather than28reducing the package to a DeepSeek-specific adapter or a one-shot model tool.29Keep these boundaries explicit:3031- Name the effective controller, provider, model, backend, worker identity, and32 lifecycle owner truthfully.33- A backend owns only the lifecycle semantics it can actually provide. Never34 present an externally managed worker as a native Codex child.35- Provider selection does not grant tool, filesystem, network, or mutation36 authority. The effective harness and environment own those permissions and37 side effects.38- Missing capability, credentials, or transport fails closed. Never silently39 change provider, model, backend, or task carrier.40- Prefer native Codex children only when the full cross-provider capability41 contract passes; otherwise select the qualified App Server fallback before42 dispatch. Never migrate a live Agent as an implicit retry.43- Route from a versioned qualification record. Do not trial-spawn a native44 child per Agent; requalify only when the Codex build, plugin, route, credential45 identity, environment, permissions, or relevant protocol changes. Start with46 offline checks, and require explicit authorization for a live canary.47- Promote a fully evidenced qualification atomically for new Agents only. Demote48 the affected key on a provider, transport, identity, or lifecycle contract49 violation, not an ordinary task failure. Reuse the same creation through App50 Server only after proving native accepted no child and began no external51 effect; ambiguity must not create a second worker.52- Preserve the native-sized Agent thread contract: `routes`, `spawn_agent`,53 `send`, `wait_agent`, `interrupt_agent`, and `list_agents`; a small status54 vocabulary; and final text or an error. Do not reintroduce a generic Job,55 revision, pending-action, cancellation, artifact, or release protocol without56 a demonstrated consumer that App Server threads cannot serve.57- Completion, failure, and interruption end the current turn, not the Agent58 thread. Follow-up input may start another turn on the same App Server thread.59- App Server owns managed thread history, turn results, and recovery. Persist60 only non-secret runtime metadata that cannot be reconstructed from it.61- Scope runtime processes by route and effective access. The `$broker` Skill62 routes qualified native Agents through Codex collaboration tools directly;63 the local STDIO MCP server owns App Server-backed Agents.64- MCP tools accept only preconfigured routes, never inline credentials,65 endpoints, headers, or provider definitions.66- Send only the complete assignment and context explicitly selected for the67 worker. Managed workers use the supplied checkout directly; the controller68 serializes overlapping writers or prepares a Codex worktree before dispatch.69- Relay transient non-secret approval or user-input requests through the host70 only when it advertises elicitation during an associated call. Otherwise71 decline explicitly; never collect credentials or expand route authority.72- Treat App Server `turn/interrupt` as a local turn result. State the provider73 compute/billing limitation instead of inventing a remote-cancellation claim.74- Treat probes as disposable evidence; record only decision-grade results in75 their durable project owner.7677The existing Codex DeepSeek package is inherited evidence, not a Broker runtime78dependency. Pi DSH mimic remains a separate first-request integration.7980## Codex DeepSeek subagent8182Read the [composition and transport design](../../../packages/codex-deepseek-subagent/docs/advanced.en.md)83before changing provider routing, child creation, Hook transport, authentication,84or installed files. Read the [security owner](../../../packages/codex-deepseek-subagent/SECURITY.md)85when a change affects credentials, plaintext state, permissions, or provider86data. The [runtime skill](../../../packages/codex-deepseek-subagent/skills/use-v4-flash-worker/SKILL.md)87is the parent Agent's installed consumer contract; update it only when that88observable contract changes.8990Keep these ownership boundaries intact:9192- `hooks/plaintext_handoff.py` and `hooks/plaintext-handoff.ps1` implement the93 same one-shot envelope and state transitions on different platforms.94- `agents/`, the Hook examples, `snippets/AGENTS.md`, and95 `prompts/install-with-codex.md` jointly define what installation distributes96 and wires into Codex.97- Codex continues to own child identity, permissions, cancellation, waiting,98 and callback. This package owns only the temporary cross-provider assignment99 transport.100101Preserve stage-before-spawn, the exact `v4_flash_worker` role,102`fork_turns="none"`, atomic at-most-once delivery, and explicit handling of103pending, claimed, expired, locked, or quarantined state. A transport failure104must not silently switch provider, model, collaboration mode, or task carrier.105Changes to this contract normally propagate across both platform scripts, the106installer and Hook templates, the runtime skill, and their focused tests.107108## Pi DSH mimic109110Read the [request and experiment design](../../../packages/pi-dsh-mimic/docs/advanced.md)111before changing activation, bootstrap payloads, tools, or stage transitions.112Read the [security owner](../../../packages/pi-dsh-mimic/SECURITY.md) when a113change affects provider data or filesystem authority.114115Use the existing code owners:116117- `src/session-stage.ts` owns route activation and durable stage restoration.118- `src/protocol.ts` owns the Minimal first-request shape and later persona119 preservation.120- `src/index.ts` maps those rules onto Pi events; `src/editor.ts` owns the121 contributed `str_replace_editor` behavior.122123The user's real task must occupy request one without a synthetic model round.124Arm only a new session whose model id contains `deepseek-v4-pro`; do not forge a125bootstrap after a conversation has started. Provider errors and aborted126responses retain the bootstrap, while a successful assistant response or real127tool call promotes the session. After promotion, Pi again owns the native128payload and full tool catalog while the Minimal persona remains. Preserve129resume and crash-stale recovery, non-target isolation, image-bearing tasks, and130the editor's explicit filesystem boundary.131132## Evidence and delivery133134Choose checks from the behavior actually changed:135136- Broker plugin, Skill, and App Server adapter:137 `npm --prefix packages/broker run check`,138 `npm --prefix packages/broker run pack:check`, plugin validation, Skill139 validation, local Markdown links, and final diff inspection. These tests use140 a fake App Server; a separate loopback-provider probe may exercise the real141 bundled Codex without contacting a provider.142- Codex templates and distribution links:143 `python3 packages/codex-deepseek-subagent/tests/test_agent_templates.py`144- POSIX handoff protocol:145 `python3 packages/codex-deepseek-subagent/tests/test_plaintext_handoff.py`146- Windows handoff protocol, on Windows:147 `powershell -NoProfile -File packages/codex-deepseek-subagent/tests/plaintext-handoff.windows.ps1`148- Pi extension behavior and package contents:149 `npm --prefix packages/pi-dsh-mimic run check` and150 `npm --prefix packages/pi-dsh-mimic run pack:check`151152These local checks make no provider call. Run a Broker provider qualification,153a DeepSeek smoke test, or a Project2 experiment only with explicit154authorization for its cost and external data boundary. Keep completion claims155backend-, platform-, provider-, and evidence-specific, and update the affected156English and Chinese public owners when observable behavior or safety guidance157changes.