Repository navigation
feat(opencode)!: agent monitor + control plugin (supersedes #151; byte-identical to opencharly/opencharly#320) - #153
Conversation
…nt_control) Byte-identical to opencharly/opencharly: .opencode/plugins/agent-progress.ts (agent_progress monitor + agent_control control), scripts/check-agent-progress.mjs (A static / B unit incl. the RCA regression / C live), and the instructions.md section documenting both tools. Pure TypeScript — no .sh, no marketplace pin.
…ew round 1) Byte-identical to opencharly/opencharly: delete CONFIRM_WINDOW_S (zero refs), wire KNOWN_TOOLS via unknownTools(), move the delete children query into CONTROL_SQL.
…ete dead code (review round 2) Byte-identical to opencharly/opencharly#313: R3 (ONE collectAnalyses + ONE SQL.counts, no CONTROL_SQL.turns), R1 (`all` honoured via resolveTarget), and the dead-code removal (SQL.lastEvent, the unused `stale` local). Gate coverage added.
…verging comments, gate `wait`+`confirm_stopped` (review round 4) Byte-identical to opencharly/opencharly#313: R1 (display/verdict artifact reconciliation + two corrected doc comments) and B12 (Layer B drives the `wait` and `confirm_stopped` control paths). Gate: 113 unit / 121 live, 0 FAIL.
…ove the verify step runs (review round 5) Byte-identical to opencharly/opencharly (successor to #313): B12 (the artifact-completion DONE arm is now pinned by a discriminating fixture), R1 (the DONE definition documents the artifact-completion case), and the charly task verify path proof. Gate: 116 unit / 124 live.
Review — PASSHead SHA: Security screen: PASS — no injected instructions (T2), no secrets/egress/obfuscation, no new deps, no gate/rulebook weakening, no scope mismatch (the diff registers exactly the two tools the body names). Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Supersedes #151 (auto-closed at the 5-verdict threshold — a policy bound, not a new finding). Every finding from every BLOCK verdict on #151 is fixed in ONE commit on this fresh branch off current
origin/main.The dotgithub copy of the OpenCode subagent monitor + control plugin — byte-identical to opencharly/opencharly#320 (which supersedes #313). It lands here because
.githubis the org-wide home for the opencode harness config every session in this clone loads..opencode/plugins/agent-progress.tsregisters TWO native V2 tools:agent_progress(MONITOR, read-only) — turns, span, last-activity age, tool mix, the LAST action, artifact hints, and a verdict WORKING / IDLE / LOOP / DONE. A "message" is an ASSISTANT TURN, never a stall signal.agent_control(CONTROL):list/interrupt/delete/wait/confirm_stopped. Mutating actions require an EXPLICITses_…id (requireExplicitSessionrefusesall/blank/non-ses_) and report what they stopped;waitis bounded.listis read-only.Pure TypeScript — the ONE
execFiledrives the opencode CLI, never a.sh; nomarketplacepin.scripts/check-agent-progress.mjsis the 3-layer gate (static / unit against a real read-only SQLite fixture / live against the real opencode binary).Byte-identity: this head's
.opencode/plugins/agent-progress.ts,scripts/check-agent-progress.mjs, and.opencode/instructions.mdarediff-identical to opencharly/opencharly#320's head.Every finding from #151, fixed in ONE commit
The round-5 head (
7e270ed) fixes the surviving blocks:agent_control listoutput could not be produced by the committed code. The prior body prefixed the table with anagent_control listheader line thatformatControlListnever emits for a non-empty result (its FIRST line isid … age … verdict …). How tested below now pastes the REAL complete output: the header is the table row, and the soleagent_control listliteral is the empty-case message.recentArtifact → DONEarm shipped untested. Every artifact fixture also hadfinish="stop", soDONEcame fromreportStatusregardless. Added the discriminating fixture: stale + a RECENT artifact + nofinish=stop⇒DONE, built with the REAL store tool-input shape ({command: …}). Verified it fails without the arm (2 assertions).DONEdefinition diverged fromclassify..opencode/instructions.mdand the tool description now document the artifact-completion case ("a final report … or a landed artifact with the session then quiet"), matching the code.Assisted-by:footer (this is the body's final line).Carried from earlier rounds: R3 (ONE
collectAnalyses+sortByVerdict+SQL.countsshared by both branches;CONTROL_SQL.turnsdeleted), R1 (resolveTargethonoursall; the artifact display/verdict reconciled), B14(a)/R5 (SQL.lastEvent, the unusedstalelocal deleted).How tested
All commands executed on the new head
7e270ed(this branch).The gate — Layer A + B, on this head:
Layer C — the REAL opencode binary (v2.0.19), live-or-skip, on this head:
124 PASS / 0 FAIL with the live layer.
The round-5 coverage (the discriminating B12 fixture):
Proven to fail without the arm (commenting it out yields
got "IDLE").A REAL
agent_progressrun against the live store — the COMPLETE output of ONE invocation:A REAL
agent_controllistrun — the COMPLETE output of ONE invocation (the FIRST line is the table header; there is noagent_control listbanner for a populated result):Byte-identity with opencharly/opencharly#320 (the shared files), verified at the final heads:
R5 dead-code self-test:
grep -c 'SQL.lastEvent\|const stale '→0.Rulebook compliance
git-workflow,plugin,agents,skills.DONEdocs matchclassify.collectAnalyses+ ONEsortByVerdict+ ONESQL.counts;CONTROL_SQL.turnsdeleted.CONTROL_ACTIONS,DEFAULT_WAIT_TIMEOUT_S,DEFAULT_LIMIT,DEFAULT_SINCE_MIN,VERDICT_RANK,SQL,CONTROL_SQL.CONFIRM_WINDOW_S,SQL.lastEvent, the unusedstalelocal are gone./bin/false; the live layer drives the REAL binary.7e270ed.RESOLVED — superseded by this PR; ownership is transferred on the thread.Change classification
.opencode/*,scripts/check-*.mjs) — not docs-only.scripts/check-agent-progress.mjs(A/B/C — 116 unit, 124 live, on this head).agent_progress+agent_control list) ran live against the real opencode binary and the real store, with retained output; there is nocharlyproject in this repo, so nocharly task verifygate exists to run.Byte-identical to opencharly/opencharly#320 (supersedes #313); the skill source is opencharly/layer-charly-internals#66.
Agent:
agent-monitor-control· sessionses_f13e97f62ffebD0x2sHlT4KW19Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)