@chankov/agent-fleet 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/set-hermes-watchdog.md +6 -0
- package/.opencode/commands/af-set-hermes-watchdog.md +6 -0
- package/.pi/harnesses/agent-hub/README.md +75 -16
- package/.pi/harnesses/agent-hub/artifacts.js +56 -2
- package/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.pi/harnesses/agent-hub/delegate.ts +58 -9
- package/.pi/harnesses/agent-hub/drift-watchdog.js +54 -8
- package/.pi/harnesses/agent-hub/helpers.ts +34 -0
- package/.pi/harnesses/agent-hub/index.ts +723 -159
- package/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +2 -2
- package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -11
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.pi/harnesses/agent-hub/return-contract.js +78 -0
- package/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.pi/harnesses/agent-hub/run-budget.js +29 -3
- package/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.pi/harnesses/agent-hub/spawn.ts +109 -1
- package/.pi/harnesses/agent-hub/spawned-peers.js +74 -0
- package/.pi/harnesses/coms/README.md +4 -3
- package/.pi/harnesses/coms/index.ts +80 -58
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.pi/harnesses/lib/herdr-client.ts +7 -2
- package/.pi/harnesses/lib/herdr-presence.ts +141 -30
- package/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
- package/.pi/harnesses/lib/hermes-monitor-registry.ts +1 -1
- package/.pi/harnesses/lib/hermes-monitor-socket.ts +47 -2
- package/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.7/.claude/commands/build.md +44 -0
- package/.versions/0.0.7/.claude/commands/code-simplify.md +22 -0
- package/.versions/0.0.7/.claude/commands/design-agent.md +14 -0
- package/.versions/0.0.7/.claude/commands/doctor-agent-fleet.md +17 -0
- package/.versions/0.0.7/.claude/commands/orchestrate.md +112 -0
- package/.versions/0.0.7/.claude/commands/plan.md +16 -0
- package/.versions/0.0.7/.claude/commands/prime.md +22 -0
- package/.versions/0.0.7/.claude/commands/review.md +16 -0
- package/.versions/0.0.7/.claude/commands/set-hermes-telegram.md +15 -0
- package/.versions/0.0.7/.claude/commands/set-hermes-watchdog.md +6 -0
- package/.versions/0.0.7/.claude/commands/setup-agent-fleet.md +25 -0
- package/.versions/0.0.7/.claude/commands/ship.md +72 -0
- package/.versions/0.0.7/.claude/commands/spec.md +15 -0
- package/.versions/0.0.7/.claude/commands/test.md +19 -0
- package/.versions/0.0.7/.claude/commands/webperf.md +32 -0
- package/.versions/0.0.7/.claude/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.7/.opencode/commands/af-build.md +17 -0
- package/.versions/0.0.7/.opencode/commands/af-code-simplify.md +16 -0
- package/.versions/0.0.7/.opencode/commands/af-compound.md +16 -0
- package/.versions/0.0.7/.opencode/commands/af-design-agent.md +15 -0
- package/.versions/0.0.7/.opencode/commands/af-doctor-agent-fleet.md +17 -0
- package/.versions/0.0.7/.opencode/commands/af-orchestrate.md +112 -0
- package/.versions/0.0.7/.opencode/commands/af-plan.md +16 -0
- package/.versions/0.0.7/.opencode/commands/af-prime.md +22 -0
- package/.versions/0.0.7/.opencode/commands/af-review.md +15 -0
- package/.versions/0.0.7/.opencode/commands/af-set-hermes-telegram.md +15 -0
- package/.versions/0.0.7/.opencode/commands/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.7/.opencode/commands/af-setup-agent-fleet.md +15 -0
- package/.versions/0.0.7/.opencode/commands/af-ship.md +16 -0
- package/.versions/0.0.7/.opencode/commands/af-spec.md +16 -0
- package/.versions/0.0.7/.opencode/commands/af-test.md +21 -0
- package/.versions/0.0.7/.opencode/commands/af-webperf.md +32 -0
- package/.versions/0.0.7/.opencode/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.7/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/0.0.7/.pi/agents/model-profiles.yaml +20 -0
- package/.versions/0.0.7/.pi/agents/peers.yaml +146 -0
- package/.versions/0.0.7/.pi/agents/teams.yaml +39 -0
- package/.versions/0.0.7/.pi/damage-control-rules.yaml +297 -0
- package/.versions/0.0.7/.pi/extensions/agent-fleet-update-check/README.md +58 -0
- package/.versions/0.0.7/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/0.0.7/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/0.0.7/.pi/extensions/btw/README.md +118 -0
- package/.versions/0.0.7/.pi/extensions/btw/index.ts +917 -0
- package/.versions/0.0.7/.pi/extensions/btw/package.json +6 -0
- package/.versions/0.0.7/.pi/extensions/btw/state.js +179 -0
- package/.versions/0.0.7/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
- package/.versions/0.0.7/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/0.0.7/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/0.0.7/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/0.0.7/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/0.0.7/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/0.0.7/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/0.0.7/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/0.0.7/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/0.0.7/.pi/extensions/package-lock.json +1143 -0
- package/.versions/0.0.7/.pi/extensions/package.json +9 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/README.md +201 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/0.0.7/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/README.md +857 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/backend-policy.js +153 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/delegate.ts +435 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/helpers.ts +248 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/index.ts +8609 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/research-retention.js +34 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/run-budget.js +181 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/spawn.ts +354 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/spawned-peers.js +74 -0
- package/.versions/0.0.7/.pi/harnesses/agent-hub/version.ts +18 -0
- package/.versions/0.0.7/.pi/harnesses/ask-user-remote/README.md +19 -0
- package/.versions/0.0.7/.pi/harnesses/ask-user-remote/index.ts +321 -0
- package/.versions/0.0.7/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/0.0.7/.pi/harnesses/coms/README.md +93 -0
- package/.versions/0.0.7/.pi/harnesses/coms/index.ts +1767 -0
- package/.versions/0.0.7/.pi/harnesses/coms/package.json +7 -0
- package/.versions/0.0.7/.pi/harnesses/coms/version.ts +18 -0
- package/.versions/0.0.7/.pi/harnesses/damage-control-continue/README.md +117 -0
- package/.versions/0.0.7/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/0.0.7/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/0.0.7/.pi/harnesses/damage-control-continue/version.ts +18 -0
- package/.versions/0.0.7/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/0.0.7/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/0.0.7/.pi/harnesses/lib/herdr-client.ts +463 -0
- package/.versions/0.0.7/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/0.0.7/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/0.0.7/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/0.0.7/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/0.0.7/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/0.0.7/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/0.0.7/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/0.0.7/.pi/harnesses/package-lock.json +35 -0
- package/.versions/0.0.7/.pi/harnesses/package.json +9 -0
- package/.versions/0.0.7/.pi/prompts/af-build.md +24 -0
- package/.versions/0.0.7/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/0.0.7/.pi/prompts/af-doctor-agent-fleet.md +15 -0
- package/.versions/0.0.7/.pi/prompts/af-plan.md +16 -0
- package/.versions/0.0.7/.pi/prompts/af-review.md +16 -0
- package/.versions/0.0.7/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/0.0.7/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.7/.pi/prompts/af-setup-agent-fleet.md +27 -0
- package/.versions/0.0.7/.pi/prompts/af-ship.md +17 -0
- package/.versions/0.0.7/.pi/prompts/af-spec.md +15 -0
- package/.versions/0.0.7/.pi/prompts/af-test.md +19 -0
- package/.versions/0.0.7/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/0.0.7/.version +1 -0
- package/.versions/0.0.7/agents/architect.md +23 -0
- package/.versions/0.0.7/agents/bowser.md +26 -0
- package/.versions/0.0.7/agents/builder.md +53 -0
- package/.versions/0.0.7/agents/code-reviewer.md +205 -0
- package/.versions/0.0.7/agents/deep-researcher.md +31 -0
- package/.versions/0.0.7/agents/documenter.md +18 -0
- package/.versions/0.0.7/agents/orchestrator.md +65 -0
- package/.versions/0.0.7/agents/plan-reviewer.md +60 -0
- package/.versions/0.0.7/agents/planner.md +69 -0
- package/.versions/0.0.7/agents/releaser.md +24 -0
- package/.versions/0.0.7/agents/researcher.md +28 -0
- package/.versions/0.0.7/agents/security-auditor.md +166 -0
- package/.versions/0.0.7/agents/test-engineer.md +151 -0
- package/.versions/0.0.7/agents/web-debugger.md +42 -0
- package/.versions/0.0.7/agents/web-performance-auditor.md +192 -0
- package/.versions/0.0.7/codex/CONDUCTOR.md +148 -0
- package/.versions/0.0.7/docs/ARCHITECTURE.md +262 -0
- package/.versions/0.0.7/docs/agent-fleet-setup.md +366 -0
- package/.versions/0.0.7/docs/claude-code-coms-bridge.md +109 -0
- package/.versions/0.0.7/docs/codex-remote-conductor.md +170 -0
- package/.versions/0.0.7/docs/coms-hermes-bridge.md +189 -0
- package/.versions/0.0.7/docs/getting-started.md +231 -0
- package/.versions/0.0.7/docs/npm-install.md +337 -0
- package/.versions/0.0.7/docs/opencode-setup.md +249 -0
- package/.versions/0.0.7/docs/pi-extensions.md +293 -0
- package/.versions/0.0.7/docs/pi-setup.md +476 -0
- package/.versions/0.0.7/docs/skill-anatomy.md +150 -0
- package/.versions/0.0.7/hermes/README.md +347 -0
- package/.versions/0.0.7/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/0.0.7/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/0.0.7/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/0.0.7/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/0.0.7/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/0.0.7/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/0.0.7/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/0.0.7/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/0.0.7/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/0.0.7/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/0.0.7/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/0.0.7/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/.versions/0.0.7/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/0.0.7/hooks/hooks.json +14 -0
- package/.versions/0.0.7/hooks/session-start.sh +74 -0
- package/.versions/0.0.7/hooks/simplify-ignore.sh +302 -0
- package/.versions/0.0.7/justfile +245 -0
- package/.versions/0.0.7/references/accessibility-checklist.md +160 -0
- package/.versions/0.0.7/references/definition-of-done.md +67 -0
- package/.versions/0.0.7/references/fleet-coordination-patterns.md +151 -0
- package/.versions/0.0.7/references/observability-checklist.md +91 -0
- package/.versions/0.0.7/references/orchestration-patterns.md +370 -0
- package/.versions/0.0.7/references/performance-checklist.md +153 -0
- package/.versions/0.0.7/references/prompting-patterns.md +380 -0
- package/.versions/0.0.7/references/security-checklist.md +179 -0
- package/.versions/0.0.7/references/testing-patterns.md +236 -0
- package/.versions/0.0.7/scripts/codex-conductor.ts +41 -0
- package/.versions/0.0.7/scripts/codex-remote-control.ts +167 -0
- package/.versions/0.0.7/scripts/coms-claude-bridge.ts +401 -0
- package/.versions/0.0.7/scripts/coms-cli.ts +484 -0
- package/.versions/0.0.7/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/0.0.7/scripts/fleet.ts +149 -0
- package/.versions/0.0.7/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/0.0.7/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/0.0.7/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/0.0.7/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/0.0.7/scripts/lib/claude-bridge-core.ts +165 -0
- package/.versions/0.0.7/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/0.0.7/scripts/lib/codex-remote-control.ts +480 -0
- package/.versions/0.0.7/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/0.0.7/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/0.0.7/scripts/lib/fleet-command.ts +109 -0
- package/.versions/0.0.7/scripts/lib/herdr-layout.ts +263 -0
- package/.versions/0.0.7/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/0.0.7/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/0.0.7/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/0.0.7/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/0.0.7/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/0.0.7/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/0.0.7/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/0.0.7/scripts/lib/monitor-env.ts +120 -0
- package/.versions/0.0.7/scripts/lib/persona-banner.ts +62 -0
- package/.versions/0.0.7/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/0.0.7/scripts/lib/team-project.ts +191 -0
- package/.versions/0.0.7/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/0.0.7/scripts/peer-banner.ts +40 -0
- package/.versions/0.0.7/scripts/team-snapshot.ts +237 -0
- package/.versions/0.0.7/scripts/team-up.ts +360 -0
- package/.versions/0.0.7/skills/_internal/grilling.md +11 -0
- package/.versions/0.0.7/skills/browser-testing-with-devtools/SKILL.md +352 -0
- package/.versions/0.0.7/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/0.0.7/skills/compound-learning/SKILL.md +137 -0
- package/.versions/0.0.7/skills/context-engineering/SKILL.md +291 -0
- package/.versions/0.0.7/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/0.0.7/skills/designing-agents/SKILL.md +394 -0
- package/.versions/0.0.7/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/0.0.7/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.7/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/0.0.7/skills/guided-workspace-setup/SKILL.md +544 -0
- package/.versions/0.0.7/skills/guided-workspace-setup/companion-manifest.json +35 -0
- package/.versions/0.0.7/skills/idea-refine/SKILL.md +182 -0
- package/.versions/0.0.7/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.7/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.7/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.7/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.7/skills/incremental-implementation/SKILL.md +287 -0
- package/.versions/0.0.7/skills/interview-me/SKILL.md +226 -0
- package/.versions/0.0.7/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/0.0.7/skills/peer-coms/SKILL.md +90 -0
- package/.versions/0.0.7/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.7/skills/planning-and-task-breakdown/SKILL.md +236 -0
- package/.versions/0.0.7/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/0.0.7/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/0.0.7/skills/using-agent-skills/SKILL.md +199 -0
- package/.versions/0.0.7/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/0.0.7/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +134 -0
- package/README.md +175 -18
- package/agents/code-reviewer.md +2 -2
- package/agents/orchestrator.md +11 -0
- package/agents/plan-reviewer.md +1 -1
- package/agents/planner.md +1 -1
- package/agents/security-auditor.md +1 -1
- package/bin/cli.js +40 -1
- package/bin/lib/hermes-profile-artifact.js +144 -0
- package/bin/lib/set-hermes-watchdog.js +173 -0
- package/bin/set-hermes-watchdog.js +26 -0
- package/docs/ARCHITECTURE.md +64 -12
- package/docs/agent-fleet-setup.md +2 -2
- package/docs/claude-code-coms-bridge.md +7 -1
- package/docs/coms-hermes-bridge.md +10 -0
- package/docs/getting-started.md +48 -0
- package/docs/hermes-watchdog-supervisor.md +140 -0
- package/hermes/README.md +135 -19
- package/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/dist/index.js +10 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/hooks/coms-stop-hook.mjs +12 -1
- package/package.json +11 -2
- package/scripts/coms-claude-bridge.ts +154 -39
- package/scripts/fleet.ts +9 -1
- package/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/scripts/lib/claude-bridge-core.ts +65 -0
- package/scripts/lib/coms-envelope.ts +44 -1
- package/scripts/lib/hermes-monitor-events.ts +1 -0
- package/scripts/lib/monitor-env.ts +120 -0
- package/scripts/team-snapshot.ts +1 -1
- package/scripts/team-up.ts +10 -1
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +0 -15
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +0 -19
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +0 -13
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +0 -11
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +0 -9
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +0 -17
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +0 -34
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +0 -39
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +0 -12
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +0 -22
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +0 -15
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +0 -19
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +0 -13
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +0 -11
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +0 -9
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +0 -17
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +0 -34
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +0 -39
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +0 -12
- package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +0 -22
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +0 -15
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +0 -19
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +0 -13
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +0 -11
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +0 -9
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +0 -17
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +0 -34
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +0 -39
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +0 -12
- package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +0 -22
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Inspect or safely install the fail-closed Hermes watchdog
|
|
3
|
+
argument-hint: "<status|install|update|uninstall> [--profile NAME] [--force] [--dry-run]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Ask for confirmation before install, update, uninstall, or force. Use only the deterministic Agent Fleet watchdog controller with the supplied separately quoted arguments. `status` is read-only; `--dry-run` writes nothing. Never start/restart a gateway or watcher, change tools, send a message, initiate a watch, or infer Gate O/origin routing. The packaged skill remains journal-only/dormant until independently reviewed live Gate O evidence exists.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Inspect or safely install the fail-closed Hermes watchdog
|
|
3
|
+
argument-hint: "<status|install|update|uninstall> [--profile NAME] [--force] [--dry-run]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Ask the user before every write or `--force`. Use the deterministic watchdog installer only; status is read-only, stopped profiles require explicit `--profile`, and the controller never changes Hermes services, starts a watcher, or changes unrelated permissions. Gate O remains unproven and fail-closed: no live origin delivery, steering, surgical, or out-of-turn chat claim.
|
|
@@ -72,7 +72,8 @@ Every borrowed idea from another harness passes one test before it lands: *does
|
|
|
72
72
|
- **Verification Contract (assertion ledger)** — the dispatcher owns a ledger of checkable
|
|
73
73
|
acceptance assertions built from the request *before* any builder runs, so a clearly stated
|
|
74
74
|
requirement is never silently dropped. `set_assertions` records the numbered, tagged assertions
|
|
75
|
-
(`test` | `runtime-ui` | `code-grep` | `manual`, one pass condition each
|
|
75
|
+
(`test` | `runtime-ui` | `code-grep` | `manual`, one pass condition each, plus a required
|
|
76
|
+
`source` naming where the requirement comes from) and rebuilds the whole
|
|
76
77
|
ledger on a "wrong again" regression reset; `update_assertion` marks each one proven (named
|
|
77
78
|
evidence required), unproven, or failed after a verification gate; `get_assertions` reads the
|
|
78
79
|
full ledger (ids, tags, pass conditions, evidence) back. The hub persists the ledger to
|
|
@@ -93,10 +94,19 @@ Every borrowed idea from another harness passes one test before it lands: *does
|
|
|
93
94
|
manual needs user/`ask_user` confirmation, and `runtime-ui` needs an existing artifact path under
|
|
94
95
|
`.pi/agent-sessions/artifacts/evidence/`. **Advisory by design** (PRD open question 2): status is
|
|
95
96
|
surfaced and "proven" requires named evidence, but a dispatch is never hard-refused on an unproven
|
|
96
|
-
assertion — code-enforcement is the Checkpoint A decision.
|
|
97
|
+
assertion — code-enforcement is the Checkpoint A decision. Two contract rules ARE enforced at the
|
|
98
|
+
tool: a batch with any sourceless assertion is refused with the offending ids named (a specialist
|
|
99
|
+
told to prove `A9` must be able to read its origin instead of spending a dispatch and an ASK_USER
|
|
100
|
+
cycle asking where `A9` was defined), and a batch over **8** open assertions is accepted with a
|
|
101
|
+
warning suggesting the split — declare the batch the next dispatches actually prove, and
|
|
102
|
+
`set_assertions` the next one when it starts.
|
|
97
103
|
- **Artifact bus** — session handoffs live under `.pi/agent-sessions/artifacts/` with conventional
|
|
98
|
-
`returns/`, `plans/`, `reviews/`, `inventories/`, and `evidence/` subdirectories, all
|
|
99
|
-
recreated at session start like `findings/`. `
|
|
104
|
+
`returns/`, `failures/`, `plans/`, `reviews/`, `inventories/`, and `evidence/` subdirectories, all
|
|
105
|
+
wiped and recreated at session start like `findings/`. `failures/` is separate on purpose: a run
|
|
106
|
+
that errored or timed out produced no specialist result, so its output goes there and the dispatch
|
|
107
|
+
result names it a **delivery failure** carrying no assertion evidence. Filing a 142-byte coms error
|
|
108
|
+
stub as `returns/code-reviewer-run4.md` once cost a 103-second dispatch investigating a review that
|
|
109
|
+
had in fact succeeded — only its reply was lost. `dispatch_agent` and `spawn_research` accept optional
|
|
100
110
|
`artifacts: string[]` paths (repo-relative or session-artifact-relative); the hub validates that
|
|
101
111
|
they stay inside the repo/session roots and injects only the path plus first heading/one-line
|
|
102
112
|
preview, never file bodies. Document-producing specialists are instructed to write plans, reviews,
|
|
@@ -140,7 +150,17 @@ Every borrowed idea from another harness passes one test before it lands: *does
|
|
|
140
150
|
from `.pi/agents/model-profiles.yaml` — a macro over the same declared candidates, validated at
|
|
141
151
|
session start (a profile with any entry outside a persona's candidates is dropped whole, with an
|
|
142
152
|
error); profiles never touch sub-role models — only `/af-agent-model` reaches those. Nothing
|
|
143
|
-
outside the declared lists is ever selectable.
|
|
153
|
+
outside the declared lists is ever selectable. When an effective project or session override
|
|
154
|
+
fails with a model/provider error or aborted request before work begins (including local-model
|
|
155
|
+
memory-limit failures), the hub retries once with the model originally declared in the persona
|
|
156
|
+
frontmatter. For **write-capable** runs this is pre-work only: no fallback occurs after text
|
|
157
|
+
output, a tool call, cancellation, timeout, drift stop, or a Pi process-spawn failure, avoiding
|
|
158
|
+
duplicate writes. **Read-only children and research helpers** (tools limited to
|
|
159
|
+
`read,grep,find,ls`) also retry once when the provider fails *mid-run* — re-running a reader
|
|
160
|
+
repeats nothing, and those are exactly the children that exist to protect their parent's context,
|
|
161
|
+
so losing one to a local-endpoint OOM halfway through discards work for no safety gain. A
|
|
162
|
+
terminated run (watchdog, deadline, cancellation) never retries either way: that is a verdict on
|
|
163
|
+
the work, not a provider outage. The failed attempt is removed from the child session before retry. Per project,
|
|
144
164
|
`model.<persona>:` / `models.<persona>:` keys under `## agent-hub` in
|
|
145
165
|
`.ai/agent-fleet-overrides.md` replace a persona's default model / candidate list.
|
|
146
166
|
Research personas (`researcher` / `deep-researcher`, `kind: research`) are switchable the same
|
|
@@ -184,8 +204,10 @@ Every borrowed idea from another harness passes one test before it lands: *does
|
|
|
184
204
|
`/af-agents-kill` on the parent SIGTERMs its whole process group, so the delegation tree dies with
|
|
185
205
|
it. `context: fork` is accepted but treated as a summary brief in v1. Per project,
|
|
186
206
|
`subagents.<persona>.<role>:` and `delegate-depth.<persona>:` keys under `## agent-hub` in
|
|
187
|
-
`.ai/agent-fleet-overrides.md` replace individual sub-roles / the depth budget.
|
|
188
|
-
|
|
207
|
+
`.ai/agent-fleet-overrides.md` replace individual sub-roles / the depth budget. An overridden
|
|
208
|
+
role retains its frontmatter model as a one-shot fallback under the same pre-work-only safety
|
|
209
|
+
rule; delegate cards and results show the model that ultimately ran. Six personas ship with
|
|
210
|
+
declared sub-roles, on a three-tier OpenAI model ladder — `gpt-5.3-codex-spark` for
|
|
189
211
|
recon/grep sweeps, `gpt-5.4` for analysis sweeps, the `gpt-5.5` (or opus) parent reserved for
|
|
190
212
|
synthesis and verdicts:
|
|
191
213
|
- `code-reviewer` — `preflight`+`docs` (spark), `quality`+`perf` (gpt-5.4); its first delegate
|
|
@@ -250,12 +272,12 @@ execution **tree**:
|
|
|
250
272
|
Navigate with `↑/↓`, press `G` to jump back to the live tail, and `Q`/`Esc` to close. The log resets
|
|
251
273
|
on each session start.
|
|
252
274
|
|
|
253
|
-
|
|
254
|
-
*
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
(`Alt+A view:
|
|
275
|
+
The agent view starts in **compact** mode, showing one line per *running* agent —
|
|
276
|
+
`name · context% · state` — *below* the input box, just above pi's status bar. Idle and done agents
|
|
277
|
+
are hidden, and the coms pool widget collapses too, so an idle session collapses to just the prompt
|
|
278
|
+
and footer. Press **`Alt+A`** to toggle to the full **dashboard** (bordered card grid drawn *above*
|
|
279
|
+
the input box) and back. The current mode and binding are shown in the footer
|
|
280
|
+
(`Alt+A view:compact` / `Alt+A view:dashboard`).
|
|
259
281
|
|
|
260
282
|
### Version footer
|
|
261
283
|
|
|
@@ -421,6 +443,36 @@ or its measured context passes 60%. The dispatch result notes the recycle so the
|
|
|
421
443
|
knows the specialist starts without session memory — task text and `artifacts:` paths must
|
|
422
444
|
carry the state, which the deliverable-to-file protocol already ensures.
|
|
423
445
|
|
|
446
|
+
Context is measured against **that agent's own** model window, resolved from pi's model
|
|
447
|
+
registry (`ctx.modelRegistry.find`) with the source recorded on every resolution. Dividing a
|
|
448
|
+
49k local model's usage by the dispatcher's window is what produced unactionable readings
|
|
449
|
+
like `⚠ Planner context at 315%`; a reading above 100% now emits a one-time diagnostic that
|
|
450
|
+
names the window and where the number came from, so a mis-resolved window is distinguishable
|
|
451
|
+
from a genuine overflow. Two recycle rules follow from it: a session at or past a **full**
|
|
452
|
+
window is recycled unconditionally (no threshold override keeps it alive), and a resumed
|
|
453
|
+
session whose *projected* prompt — prior tokens plus this task — would overflow is recycled
|
|
454
|
+
**before** the spawn instead of after the run.
|
|
455
|
+
|
|
456
|
+
#### Per-provider concurrency
|
|
457
|
+
|
|
458
|
+
A dispatch may fan out to four delegate children at once and several specialists can be
|
|
459
|
+
mid-run, with nothing bounding how many requests land on one provider. That is fine against
|
|
460
|
+
a hosted endpoint and not against a local one. Requests are capped per process — **2 in
|
|
461
|
+
flight for `custom/*` by default, unlimited elsewhere**:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
AGENT_HUB_PROVIDER_LIMITS="custom=4" # raise the local cap
|
|
465
|
+
AGENT_HUB_PROVIDER_LIMITS="custom=off" # disable it
|
|
466
|
+
AGENT_HUB_PROVIDER_LIMITS="custom=2,ollama=1"
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
Queued runs still execute — they wait for a permit, and the wait is announced rather than
|
|
470
|
+
looking like a hang. The cap applies per **level** of the delegation tree (each pi process
|
|
471
|
+
runs its own semaphore over the children it spawns), and a nested spawn reuses its parent's
|
|
472
|
+
permit, so a child can never wait on its own ancestor. The drift judge and the return
|
|
473
|
+
extractor are deliberately ungated: both run while a specialist holds a permit, so queueing
|
|
474
|
+
them behind it would stall the watchdog meant to stop it.
|
|
475
|
+
|
|
424
476
|
The per-run deadline lands as `turn_timeout` (exit 124) with partial output preserved, for
|
|
425
477
|
dispatched specialists, research helpers, and nested delegate children alike — a hung child
|
|
426
478
|
can no longer hold its parent for hours.
|
|
@@ -496,9 +548,13 @@ Inside a [herdr](https://herdr.dev) pane with a live server, the dispatcher's to
|
|
|
496
548
|
surface additionally gets (absent otherwise, like coms):
|
|
497
549
|
|
|
498
550
|
- `herdr_spawn_peer` — stand up a persona peer (joins the coms pool via `just _peer`) or a
|
|
499
|
-
raw command pane in the current workspace
|
|
551
|
+
raw command pane in the current workspace. A persona peer **boots idle** and does nothing until
|
|
552
|
+
a `coms_send` reaches it, so the call waits (bounded, ~45s) for it to register and returns
|
|
553
|
+
`peer_ready` plus its coms name instead of a bare pane id. Peers spawned but never addressed are
|
|
554
|
+
named at turn end and in `/af-hub-report` with a close suggestion — closing stays the human's call
|
|
500
555
|
- `herdr_read_pane` — bounded `pane.read` (≤200 lines), read-to-decide on workers/tools;
|
|
501
|
-
messaging still goes through coms
|
|
556
|
+
messaging still goes through coms, and peer busy state comes from `coms_list`, not from
|
|
557
|
+
reading the screen
|
|
502
558
|
- `herdr_close_pane` — kills a pane; **asks the human to confirm every call**; the
|
|
503
559
|
bash-level `herdr pane close`/`workspace close`/`server stop` verbs are hard-blocked
|
|
504
560
|
for spawned specialists by `.pi/damage-control-rules.yaml`
|
|
@@ -542,7 +598,10 @@ under `~/.pi/coms/projects/<project>/agents/<name>.json` and is created at runti
|
|
|
542
598
|
confirms it with the user, then dispatches the `documenter` to land the approved lessons as
|
|
543
599
|
minimal diffs on the project's `rules:`/`docs:` targets per `skills/compound-learning/SKILL.md`.
|
|
544
600
|
Requires the `documenter` persona in the active team; run it before `/af-handoff` or session end.
|
|
545
|
-
- `coms_list` — discover the peers in your pool: names, models, live context usage, purpose
|
|
601
|
+
- `coms_list` — discover the peers in your pool: names, models, live context usage, purpose,
|
|
602
|
+
`pane_id`, and `status` (`idle` | `working` | `booting`). Check status before sending: `working`
|
|
603
|
+
means your send waits behind the peer's current turn, `booting` means it is not addressable yet.
|
|
604
|
+
This is the field whose absence drove 127 `herdr_read_pane` calls in one session. Scoped
|
|
546
605
|
to your project and excluding private peers; the LLM cannot widen it (see
|
|
547
606
|
[Pool scope is the reach boundary](#pool-scope-is-the-reach-boundary)).
|
|
548
607
|
- `coms_send` — send a prompt to a peer **in your pool**; returns a `msg_id`
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// `failures` is deliberately its own kind, not a flavour of `returns`: a run
|
|
4
|
+
// that errored or timed out produced no specialist result, and storing its error
|
|
5
|
+
// text as a return is the most expensive artifact in the system — a 142-byte
|
|
6
|
+
// coms error stub written to returns/code-reviewer-run4.md cost a full dispatch
|
|
7
|
+
// investigating a review that had in fact succeeded, only its reply was lost.
|
|
8
|
+
export const ARTIFACT_KINDS = ["returns", "failures", "plans", "reviews", "inventories", "evidence"];
|
|
4
9
|
|
|
5
10
|
const SESSION_RELATIVE_PREFIXES = new Set(["artifacts", "findings", "delegations"]);
|
|
6
11
|
const PREVIEW_LIMIT = 180;
|
|
@@ -44,14 +49,63 @@ export function resolveArtifactPath(inputPath, options) {
|
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
const exists = typeof options.exists === "function" ? options.exists : () => true;
|
|
47
|
-
const
|
|
52
|
+
const found = valid.find((candidate) => exists(candidate.target));
|
|
53
|
+
if (found) {
|
|
54
|
+
return {
|
|
55
|
+
input: raw,
|
|
56
|
+
path: found.target,
|
|
57
|
+
displayPath: displayPath(found.target, found.displayBase, found.prefix),
|
|
58
|
+
resolvedFromKind: null,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Nothing at the requested path. The hub writes EVERY auto-return under
|
|
63
|
+
// `returns/`, while the deliverable protocol teaches dispatchers that documents
|
|
64
|
+
// live in `artifacts/<kind>/` — so `reviews/code-reviewer-run1.md` is the
|
|
65
|
+
// natural and wrong guess for a file that is sitting in `returns/`. Look for
|
|
66
|
+
// the same name under the other kinds instead of reporting a missing file.
|
|
67
|
+
const requested = matchKindPath(normalized);
|
|
68
|
+
if (requested) {
|
|
69
|
+
const hits = ARTIFACT_KINDS
|
|
70
|
+
.filter((kind) => kind !== requested.kind)
|
|
71
|
+
.map((kind) => ({ kind, target: resolve(artifactRoot, `${kind}/${requested.rest}`) }))
|
|
72
|
+
.filter((candidate) => isWithin(artifactRoot, candidate.target) && exists(candidate.target));
|
|
73
|
+
if (hits.length === 1) {
|
|
74
|
+
return {
|
|
75
|
+
input: raw,
|
|
76
|
+
path: hits[0].target,
|
|
77
|
+
displayPath: displayPath(hits[0].target, artifactRoot, "artifacts"),
|
|
78
|
+
resolvedFromKind: hits[0].kind,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Never guess between kinds: two files with the same name are two documents.
|
|
82
|
+
if (hits.length > 1) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
`Ambiguous artifact ${raw}: "${requested.rest}" exists under ${hits.map((h) => `${h.kind}/`).join(" and ")}. ` +
|
|
85
|
+
"Name the kind explicitly.",
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const picked = valid[0];
|
|
48
91
|
return {
|
|
49
92
|
input: raw,
|
|
50
93
|
path: picked.target,
|
|
51
94
|
displayPath: displayPath(picked.target, picked.displayBase, picked.prefix),
|
|
95
|
+
resolvedFromKind: null,
|
|
52
96
|
};
|
|
53
97
|
}
|
|
54
98
|
|
|
99
|
+
/** `reviews/x.md` / `artifacts/reviews/x.md` → `{ kind: "reviews", rest: "x.md" }`. */
|
|
100
|
+
function matchKindPath(normalized) {
|
|
101
|
+
const parts = String(normalized || "").split("/").filter(Boolean);
|
|
102
|
+
const offset = parts[0] === "artifacts" ? 1 : 0;
|
|
103
|
+
const kind = parts[offset];
|
|
104
|
+
if (!ARTIFACT_KINDS.includes(kind)) return null;
|
|
105
|
+
const rest = parts.slice(offset + 1).join("/");
|
|
106
|
+
return rest ? { kind, rest } : null;
|
|
107
|
+
}
|
|
108
|
+
|
|
55
109
|
export function resolveArtifactPaths(paths, options) {
|
|
56
110
|
return (paths || []).map((p) => resolveArtifactPath(p, options));
|
|
57
111
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Assertion-ledger contract — pure validation for the `set_assertions` tool.
|
|
2
|
+
//
|
|
3
|
+
// Two rules, both drawn from the post-mortem of the hub sessions that declared
|
|
4
|
+
// 30 assertions (GO1–GO5, A1–A25) in one call and then spent a dispatch plus an
|
|
5
|
+
// ASK_USER cycle answering "where were A9–A16 defined?":
|
|
6
|
+
//
|
|
7
|
+
// 1. Every assertion names its origin, so an id can always be traced back to
|
|
8
|
+
// the plan/spec line it came from. Refused when missing — a sourceless id
|
|
9
|
+
// is exactly the failure that cost the cycle.
|
|
10
|
+
// 2. The open ledger is capped at MAX_OPEN_ASSERTIONS per batch. Warned, not
|
|
11
|
+
// refused: a large task legitimately has many assertions, they just should
|
|
12
|
+
// not all be open at once. Declare the rest when their batch starts.
|
|
13
|
+
|
|
14
|
+
export const MAX_OPEN_ASSERTIONS = 8;
|
|
15
|
+
|
|
16
|
+
const str = (v) => String(v ?? "").trim();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Validate + normalize one `set_assertions` batch.
|
|
20
|
+
* Returns { ok, refusal?, warning, assertions } — `assertions` is empty on a
|
|
21
|
+
* refusal so a rejected batch can never half-replace the live ledger.
|
|
22
|
+
*/
|
|
23
|
+
export function validateAssertionBatch(input) {
|
|
24
|
+
const batch = Array.isArray(input) ? input : [];
|
|
25
|
+
|
|
26
|
+
const sourceless = batch
|
|
27
|
+
.map((a, i) => (str(a?.source) === "" ? str(a?.id) || `#${i + 1}` : null))
|
|
28
|
+
.filter((label) => label !== null);
|
|
29
|
+
|
|
30
|
+
if (sourceless.length > 0) {
|
|
31
|
+
return {
|
|
32
|
+
ok: false,
|
|
33
|
+
refusal:
|
|
34
|
+
`Ledger unchanged: ${sourceless.length} assertion(s) declare no source — ${sourceless.join(", ")}. ` +
|
|
35
|
+
"Every assertion must name where it comes from (e.g. source: \"PLAN-x.md:585-595\", " +
|
|
36
|
+
"\"user request\", \"review finding F3\") so a specialist asked to prove it can read the origin " +
|
|
37
|
+
"instead of asking. Re-send the batch with a source on each.",
|
|
38
|
+
warning: null,
|
|
39
|
+
assertions: [],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const assertions = batch.map((a) => ({
|
|
44
|
+
id: str(a?.id),
|
|
45
|
+
tag: str(a?.tag),
|
|
46
|
+
text: str(a?.text),
|
|
47
|
+
source: str(a?.source),
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
const warning =
|
|
51
|
+
assertions.length > MAX_OPEN_ASSERTIONS
|
|
52
|
+
? `⚠ ${assertions.length} assertions are open at once (soft cap ${MAX_OPEN_ASSERTIONS}). ` +
|
|
53
|
+
"Keep this batch to the assertions the next dispatches actually prove and defer the rest — " +
|
|
54
|
+
"declare them with a fresh set_assertions when their batch starts. Accepted as-is."
|
|
55
|
+
: null;
|
|
56
|
+
|
|
57
|
+
return { ok: true, warning, assertions };
|
|
58
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Context-window resolution and the pre-spawn overflow guard.
|
|
2
|
+
//
|
|
3
|
+
// The bug this fixes: the hub measured EVERY specialist and research helper
|
|
4
|
+
// against `ctx.model.contextWindow` — the DISPATCHER's window. A specialist on
|
|
5
|
+
// custom/Qwen3.6-35B-A3B-4bit (49152) and one on a 400k hosted model were
|
|
6
|
+
// divided by the same number, so `⚠ Planner context at 315%` could mean either
|
|
7
|
+
// "the window is wrong for that provider" or "the run really did run 3× over",
|
|
8
|
+
// and nothing in the output told them apart.
|
|
9
|
+
//
|
|
10
|
+
// The authoritative source is pi's own model registry (ctx.modelRegistry.find),
|
|
11
|
+
// which is where the dispatcher's own window came from. This module keeps the
|
|
12
|
+
// resolution pure by taking a `lookup(provider, modelId)` function, and records
|
|
13
|
+
// WHERE each window came from so a wrong number is traceable rather than
|
|
14
|
+
// mysterious.
|
|
15
|
+
|
|
16
|
+
/** Stop resuming a session when the projected prompt reaches this share of the window. */
|
|
17
|
+
export const PRESPAWN_HEADROOM = 0.9;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* "openrouter/google/gemini-3-flash-preview" → provider "openrouter",
|
|
21
|
+
* model id "google/gemini-3-flash-preview". A spec with no slash has no
|
|
22
|
+
* provider and cannot be looked up.
|
|
23
|
+
*/
|
|
24
|
+
export function splitModelSpec(spec) {
|
|
25
|
+
const s = String(spec ?? "").trim();
|
|
26
|
+
const slash = s.indexOf("/");
|
|
27
|
+
if (slash <= 0 || slash === s.length - 1) return { provider: "", modelId: s };
|
|
28
|
+
return { provider: s.slice(0, slash), modelId: s.slice(slash + 1) };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Resolve the context window for a model spec.
|
|
33
|
+
* `lookup(provider, modelId)` is pi's registry find (may return undefined);
|
|
34
|
+
* `fallbackWindow` is the dispatcher's own window, used only when the registry
|
|
35
|
+
* has nothing. Returns { window, source } — source names the origin so a
|
|
36
|
+
* suspicious percentage can be traced to the number that produced it.
|
|
37
|
+
*/
|
|
38
|
+
export function resolveContextWindow(spec, { lookup, fallbackWindow = 0 } = {}) {
|
|
39
|
+
const { provider, modelId } = splitModelSpec(spec);
|
|
40
|
+
if (provider && typeof lookup === "function") {
|
|
41
|
+
let model;
|
|
42
|
+
try { model = lookup(provider, modelId); } catch { model = undefined; }
|
|
43
|
+
const win = Number(model?.contextWindow);
|
|
44
|
+
if (Number.isFinite(win) && win > 0) {
|
|
45
|
+
return { window: win, source: `pi model registry (${provider}/${modelId})` };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const fallback = Number(fallbackWindow);
|
|
49
|
+
if (Number.isFinite(fallback) && fallback > 0) {
|
|
50
|
+
return {
|
|
51
|
+
window: fallback,
|
|
52
|
+
// Named explicitly: this is the number that made 315% ambiguous.
|
|
53
|
+
source: `dispatcher's own model — not ${spec || "this model"}'s window`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return { window: 0, source: "unknown" };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Percent of the window consumed. 0 when the window is unknown. */
|
|
60
|
+
export function contextPct({ input = 0, cacheRead = 0, cacheWrite = 0 } = {}, window) {
|
|
61
|
+
const win = Number(window);
|
|
62
|
+
if (!Number.isFinite(win) || win <= 0) return 0;
|
|
63
|
+
return (((input || 0) + (cacheRead || 0) + (cacheWrite || 0)) / win) * 100;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Rough prompt size in tokens. Deliberately crude (~4 chars/token) — it decides
|
|
68
|
+
* whether to start a session fresh, and being approximately right before the
|
|
69
|
+
* run beats being exactly right after it.
|
|
70
|
+
*/
|
|
71
|
+
export function estimatePromptTokens(text) {
|
|
72
|
+
return Math.ceil(String(text ?? "").length / 4);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Pre-spawn guard: would resuming this session overflow the window? Recycling
|
|
77
|
+
* AFTER the run is what made the post-mortem's warnings arrive 985s too late.
|
|
78
|
+
* `priorTokens` is the resumed session's last measured total.
|
|
79
|
+
*/
|
|
80
|
+
export function shouldRecycleBeforeSpawn({ priorTokens = 0, promptTokens = 0, window, headroom = PRESPAWN_HEADROOM }) {
|
|
81
|
+
const win = Number(window);
|
|
82
|
+
if (!Number.isFinite(win) || win <= 0) return null;
|
|
83
|
+
if (priorTokens <= 0) return null; // nothing accumulated — nothing to drop
|
|
84
|
+
const projected = priorTokens + promptTokens;
|
|
85
|
+
const limit = win * headroom;
|
|
86
|
+
if (projected < limit) return null;
|
|
87
|
+
return {
|
|
88
|
+
projected,
|
|
89
|
+
window: win,
|
|
90
|
+
message:
|
|
91
|
+
`projected prompt ~${Math.round(projected / 1000)}k tokens against a ${Math.round(win / 1000)}k window ` +
|
|
92
|
+
`(${Math.round((projected / win) * 100)}%)`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The one-time diagnostic for a reading over 100%: name the window and where it
|
|
98
|
+
* came from, so "wrong window" and "genuine overflow" stop looking identical.
|
|
99
|
+
*/
|
|
100
|
+
export function overWindowDiagnostic({ agent, model, pct, window, source }) {
|
|
101
|
+
return (
|
|
102
|
+
`⚠ ${agent} measured ${Math.round(pct)}% of its context window (${Math.round(window / 1000)}k tokens, ` +
|
|
103
|
+
`source: ${source}) on ${model}. Over 100% means either that window is wrong for this provider or the ` +
|
|
104
|
+
"run genuinely exceeded it — compare the model's declared window before treating the number as real."
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -35,10 +35,12 @@ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
|
35
35
|
import { Type } from "@sinclair/typebox";
|
|
36
36
|
import { appendFileSync, mkdirSync, writeFileSync } from "fs";
|
|
37
37
|
import type { ChildProcess } from "child_process";
|
|
38
|
-
import {
|
|
38
|
+
import { spawnPiAgentWithModelFallback, killPiTree } from "./spawn.ts";
|
|
39
|
+
import { DEFAULT_PROVIDER_LIMITS, createProviderSemaphore, parseProviderLimits } from "./provider-semaphore.js";
|
|
39
40
|
import {
|
|
40
41
|
delegateBudgetRefusal,
|
|
41
42
|
DELEGATE_TREE_SPAWN_BUDGET,
|
|
43
|
+
isReadOnlyToolList,
|
|
42
44
|
normalizeDelegateRuntimeBudgets,
|
|
43
45
|
planDelegateSpawn,
|
|
44
46
|
resolveDelegateTools,
|
|
@@ -59,7 +61,7 @@ const TIMELINE_FLUSH_MS = 700;
|
|
|
59
61
|
export interface DelegateConfig {
|
|
60
62
|
persona: string;
|
|
61
63
|
tag: string;
|
|
62
|
-
roles: Record<string, { model: string; tools?: string }>;
|
|
64
|
+
roles: Record<string, { model: string; tools?: string; fallbackModel?: string }>;
|
|
63
65
|
depth: number;
|
|
64
66
|
callBudget: number;
|
|
65
67
|
remainingSpawns?: number;
|
|
@@ -139,6 +141,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
139
141
|
let liveCount = 0;
|
|
140
142
|
const liveChildren = new Set<ChildProcess>();
|
|
141
143
|
|
|
144
|
+
// Per-provider concurrency. Four read-only children fanning out at once is a
|
|
145
|
+
// feature against a hosted provider and a mid-run OOM against the local one,
|
|
146
|
+
// so `custom/*` queues past 2 in flight. Queued children still run — they
|
|
147
|
+
// just wait for a permit instead of racing for the same GPU.
|
|
148
|
+
const providerSemaphore = createProviderSemaphore({
|
|
149
|
+
...DEFAULT_PROVIDER_LIMITS,
|
|
150
|
+
...parseProviderLimits(process.env.AGENT_HUB_PROVIDER_LIMITS),
|
|
151
|
+
});
|
|
152
|
+
|
|
142
153
|
// Fallback cascade: the primary kill path is the process group (the hub
|
|
143
154
|
// signals the specialist's negative PID), but if only this process is
|
|
144
155
|
// terminated, forward the signal to any live children.
|
|
@@ -285,6 +296,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
285
296
|
const flushTimer = setInterval(flushTimeline, TIMELINE_FLUSH_MS);
|
|
286
297
|
|
|
287
298
|
const startTime = Date.now();
|
|
299
|
+
// Time spent waiting for a provider permit, reported alongside `elapsed`
|
|
300
|
+
// so a queued child is never mistaken for a slow one (the run deadline is
|
|
301
|
+
// measured from the spawn, not from here).
|
|
302
|
+
let queuedMs = 0;
|
|
288
303
|
let childProc: ChildProcess | null = null;
|
|
289
304
|
const mode = context?.trim().toLowerCase();
|
|
290
305
|
const brief = context && mode !== "summary" && mode !== "fork" ? context : undefined;
|
|
@@ -295,7 +310,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
295
310
|
let res;
|
|
296
311
|
liveCount++;
|
|
297
312
|
try {
|
|
298
|
-
|
|
313
|
+
const providerCap = providerSemaphore.limitFor(roleDef.model);
|
|
314
|
+
if (providerCap != null && providerSemaphore.inFlight(roleDef.model) >= providerCap) {
|
|
315
|
+
const ahead = providerSemaphore.queued(roleDef.model) + 1;
|
|
316
|
+
emit({ t: "queued", id: childId, model: roleDef.model, ahead, ts: Date.now() });
|
|
317
|
+
onUpdate?.({
|
|
318
|
+
content: [{ type: "text", text: `${roleKey} queued — ${providerCap} requests already in flight on this provider (${ahead} waiting)...` }],
|
|
319
|
+
details: { id: childId, role: roleKey, model: roleDef.model, status: "queued" },
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
res = await providerSemaphore.run(roleDef.model, () => {
|
|
323
|
+
queuedMs = Date.now() - startTime;
|
|
324
|
+
return spawnPiAgentWithModelFallback({
|
|
299
325
|
model: roleDef.model,
|
|
300
326
|
tools: childTools,
|
|
301
327
|
thinking: "off",
|
|
@@ -315,8 +341,19 @@ export default function (pi: ExtensionAPI) {
|
|
|
315
341
|
// Whole-run bound from the hub's mode budget: a hung delegate (the
|
|
316
342
|
// 92-minute conventions scout) must not hold its parent hostage.
|
|
317
343
|
turnDeadlineMs: config.turnDeadlineMs === undefined ? null : config.turnDeadlineMs,
|
|
318
|
-
}, {
|
|
319
|
-
onProcess: (p) => {
|
|
344
|
+
}, roleDef.fallbackModel, {
|
|
345
|
+
onProcess: (p) => {
|
|
346
|
+
if (childProc) liveChildren.delete(childProc);
|
|
347
|
+
childProc = p;
|
|
348
|
+
liveChildren.add(p);
|
|
349
|
+
},
|
|
350
|
+
onModelFallback: (notice) => {
|
|
351
|
+
emit({ t: "model_fallback", id: childId, ...notice, ts: Date.now() });
|
|
352
|
+
onUpdate?.({
|
|
353
|
+
content: [{ type: "text", text: `Override ${notice.from} failed before work began; retrying ${roleKey} with ${notice.to}...` }],
|
|
354
|
+
details: { id: childId, role: roleKey, model: notice.to, fallback: notice, status: "running" },
|
|
355
|
+
});
|
|
356
|
+
},
|
|
320
357
|
onTextDelta: (delta) => queueDelta("text", delta),
|
|
321
358
|
onThinkingDelta: (delta) => queueDelta("thinking", delta),
|
|
322
359
|
onToolStart: (toolName, argStr) => {
|
|
@@ -328,6 +365,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
328
365
|
emit({ t: "usage", id: childId, input: usage.input || 0, output: usage.output || 0 });
|
|
329
366
|
}
|
|
330
367
|
},
|
|
368
|
+
}, {
|
|
369
|
+
// A child holding only read tools can be re-run safely, so a
|
|
370
|
+
// provider dying halfway through is recoverable rather than a
|
|
371
|
+
// discarded run. A write-capable child keeps the strict rule:
|
|
372
|
+
// a retry there could duplicate edits. A child that can delegate
|
|
373
|
+
// carries `delegate` in its tool list and so reads as non-read-only
|
|
374
|
+
// here — deliberately: retrying it would re-spawn its grandchildren.
|
|
375
|
+
midRun: isReadOnlyToolList(childTools),
|
|
376
|
+
});
|
|
331
377
|
});
|
|
332
378
|
} finally {
|
|
333
379
|
liveCount--;
|
|
@@ -338,7 +384,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
338
384
|
flushTimeline();
|
|
339
385
|
const elapsed = Date.now() - startTime;
|
|
340
386
|
const code = res.spawnError ? 1 : (res.termination ? (res.termination.reason === "cancelled" ? 130 : res.termination.reason === "drift_stop" ? 125 : 124) : (res.exitCode ?? 1));
|
|
341
|
-
emit({ t: "exit", id: childId, code, elapsed, termination: res.termination, ts: Date.now() });
|
|
387
|
+
emit({ t: "exit", id: childId, code, elapsed, ...(queuedMs > 0 ? { queuedMs } : {}), termination: res.termination, ts: Date.now() });
|
|
342
388
|
|
|
343
389
|
if (res.spawnError) {
|
|
344
390
|
const spawnFailure = `Delegate ${childId} failed to spawn: ${res.spawnError}`;
|
|
@@ -375,11 +421,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
375
421
|
if (mode === "fork") notes.push("context: fork is not supported in v1 — the child started fresh from your instruction");
|
|
376
422
|
const noteBlock = notes.length > 0 ? `\n[note: ${notes.join("; ")}]` : "";
|
|
377
423
|
|
|
424
|
+
const fallbackNote = res.modelFallback
|
|
425
|
+
? `\n[note: overridden model ${res.modelFallback.from} failed before work; retried once with original ${res.modelFallback.to}]`
|
|
426
|
+
: "";
|
|
378
427
|
return {
|
|
379
428
|
content: [{ type: "text" as const, text:
|
|
380
|
-
`[delegate ${childId} · ${
|
|
381
|
-
`in ${Math.round(elapsed / 1000)}s${noteBlock}\n\n${digest.text}` }],
|
|
382
|
-
details: { id: childId, role: roleKey, model:
|
|
429
|
+
`[delegate ${childId} · ${res.modelUsed} · ${effectiveTools}] ${res.termination ? res.termination.reason : code === 0 ? "done" : "error"} ` +
|
|
430
|
+
`in ${Math.round(elapsed / 1000)}s${noteBlock}${fallbackNote}\n\n${digest.text}` }],
|
|
431
|
+
details: { id: childId, role: roleKey, model: res.modelUsed, fallback: res.modelFallback, status: res.termination ? res.termination.reason : code === 0 ? "done" : "error", elapsed, resultPath: childResultFile, digestFound: digest.hasDigest, termination: res.termination },
|
|
383
432
|
};
|
|
384
433
|
},
|
|
385
434
|
});
|