Repository navigation
Conversation
…unt limit The prior rule's "~50 messages" trigger was a guidance failure: a "message" is one ASSISTANT TURN (one model response + its tool calls), so counting turns penalises an agent for WORKING. RCA of a "79-message / no artifact" session: 74 assistant turns, tools shell/read/write x73 each, ~37 min - the agent was reading/writing/running its task; I rotated it away from work in progress. Replaces the magic number with: artifact (a CHANGED pushed commit/PR/merge/tag/measured output) = the signal; cadence (steady tool calls) = working, give it room; loop (same failing action, no artifact change) = the real pathology. Rotate ONLY on: >2 ORCHESTRATOR re-briefs of the same task; idle past the window with no artifact; or a repeated failing action. NEVER on turn count. Diagnose BEFORE rotating: read the transcript (session_message type=assistant; tool mix; last actions) - evidence, not a counter. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
…cadence, no counter) The prior rule's "~50 messages / turn-count" trigger was a guidance failure: a "message" is one ASSISTANT TURN (one model response + its tool calls), so counting turns penalised an agent for WORKING. RCA of the session I rotated: 74 assistant turns, tools shell/read/write x73 each over ~37 min - it was reading/writing/running, not stalled. Replaces the heuristic with the whole contract, in three parts: - Instruct: one task, deliverable + DoD, named skills, pasted head-anchored evidence. - Use: fresh session per task; reuse only to continue the same task; continue a worker's own PR via its session unless it finished/stalled. - Monitor: artifact (a CHANGED commit/PR/merge/tag/measured output) + cadence (steady tool calls = working) + loop (same failing action) - NEVER a turn counter. Rotate only on orchestrator re-brief thrash (>2), idle-past-window with no artifact, or a loop. Diagnose from the transcript (session_message type=assistant; tool mix; last actions). Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Change class: docs-only ( Blocks
Note (non-blocking): the change spans two non-changelog commits ( Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…nd how to do it)
Field failure: I announced a rotation on charly#714 and spawned a successor but never
stopped the predecessor, so TWO sessions worked the scope (duplicate bed work, both
watching for the other's PR). I also wrongly claimed there was "no way to stop a
subagent" — false: `opencode session delete <id>` and POST /api/session/{id}/interrupt
exist. Adds the clause + the exact mechanism + the CONFIRM-stopped requirement.
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Change class: docs-only ( Blocks
Comment dispositions
Note (non-blocking, tool-limited): the new "Use" bullet renders its code spans with escaped backticks ( Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…/use/monitor), one wave
Consolidates the guidance fixes into ONE consistent section set, because the prior
state was self-contradictory: AGENTS.md said monitor-by-artifact in one place while a
second section still carried the superseded turn-count trigger.
1. Responsibilities — main session vs subagent (NEW)
- main session owns the OUTCOME; a subagent only EXECUTES ITS BRIEF.
- main session: reads every validator verdict IN FULL and acts on each; answers comments
on OTHER sessions blocking PRs (rule 9 channel); writes every PR body; decides the
merge; owns the brief/scope/lifecycle; verifies every result against the live artifact.
- subagent: executes only its brief; loads named skills before the first tool call; runs
the embedded self-audit before the first push; never merges/coordinates/widens scope.
- Rule of ambiguity: an unnamed duty belongs to the main session.
- The PR lifecycle: author opens the PR; main session watches the verdict; author fixes
the BLOCK; main session GATES the push (every block enumerated, each confirmed
addressed, all findings in ONE commit; a partial fix is never pushed).
2. Subagent lifecycle — instruct, use, monitor
- Instruct: the brief as a structural template (task, deliverable+DoD, named skills with
the skill-tool mandate, embedded pre-validator self-audit, context, head-anchored
evidence, rules, completion).
- Use: fresh session per task; rotation is STOP + spawn (opencode session delete /
POST /api/session/{id}/interrupt) and CONFIRM stopped.
- Monitor: artifact + cadence + loop; rotate only on re-brief thrash (>2) / idle-past-
window with no artifact / a repeated failing action - NEVER a turn count.
Supersedes #308 (folded in).
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)
|
RESOLVED — superseded by #311. The Closed so the two overlapping guidance PRs do not drift (R3): |
… lifecycle (instruct/use/monitor) (#311) * docs(agents)!: the responsibility contract — main session vs subagent RCA: the role matrix lived only in the agents skill reference; AGENTS.md (auto-read by every instance) had NO section defining the main session vs subagent duties. "Who reads the validator BLOCK in full / answers other PRs comments / writes the body / decides the merge" was ambiguous (grep: 0 hits for each). Adds the ownership contract: the MAIN SESSION owns the outcome — reads every verdict in full and acts on each, answers blocking PRs comments (rule 9 channel), writes every body, decides the merge, owns the brief/scope/lifecycle, and verifies every result against the live artifact. A SUBAGENT executes only its brief, loads the named skills, runs the embedded self-audit, never merges or coordinates. Ambiguity rule: anything unnamed is the main session\047s. Cross-ref the agents skill role matrix. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (documentation reviewed) * docs(agents)!: responsibility contract + subagent lifecycle (instruct/use/monitor), one wave Consolidates the guidance fixes into ONE consistent section set, because the prior state was self-contradictory: AGENTS.md said monitor-by-artifact in one place while a second section still carried the superseded turn-count trigger. 1. Responsibilities — main session vs subagent (NEW) - main session owns the OUTCOME; a subagent only EXECUTES ITS BRIEF. - main session: reads every validator verdict IN FULL and acts on each; answers comments on OTHER sessions blocking PRs (rule 9 channel); writes every PR body; decides the merge; owns the brief/scope/lifecycle; verifies every result against the live artifact. - subagent: executes only its brief; loads named skills before the first tool call; runs the embedded self-audit before the first push; never merges/coordinates/widens scope. - Rule of ambiguity: an unnamed duty belongs to the main session. - The PR lifecycle: author opens the PR; main session watches the verdict; author fixes the BLOCK; main session GATES the push (every block enumerated, each confirmed addressed, all findings in ONE commit; a partial fix is never pushed). 2. Subagent lifecycle — instruct, use, monitor - Instruct: the brief as a structural template (task, deliverable+DoD, named skills with the skill-tool mandate, embedded pre-validator self-audit, context, head-anchored evidence, rules, completion). - Use: fresh session per task; rotation is STOP + spawn (opencode session delete / POST /api/session/{id}/interrupt) and CONFIRM stopped. - Monitor: artifact + cadence + loop; rotate only on re-brief thrash (>2) / idle-past- window with no artifact / a repeated failing action - NEVER a turn count. Supersedes #308 (folded in). Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (documentation reviewed) * docs(agents)!: make the stop clause harness-neutral (R4a) - mechanism lives in the skill The validator's block was right: the policy prose prescribed raw harness commands (session delete / interrupt via the harness API) in AGENTS.md, which violates the charly-CLI discipline / R4a (a missing charly verb is a product defect, not permission to document a non-charly command in the rulebook; no raw podman/docker/systemctl substitutes). The stop MECHANISM (the per-harness verb) is owned by the agents skill; AGENTS.md now names only the requirement (STOP, then CONFIRM stopped, before the successor starts). Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (documentation reviewed) --------- Co-authored-by: atrawog <[email protected]>
Summary
Replace the subagent-lifecycle guidance with the whole contract — instruct, use,
monitor — and remove the magic-number heuristic.
The prior rule (merged in
#305) carried a "~50 messages" rotate trigger. That was aguidance failure: a "message" is one ASSISTANT TURN (one model response with its
tool calls), so counting turns penalises an agent for working. Its evidence was one
anecdote ("351 messages") I never actually read.
RCA (measured)
The session I rotated for "79 messages / no artifact":
So "79 messages" was the agent doing its job. The trigger punished the very behaviour
(a long bed run, a large read) the task required — and caused a real stall by rotating away
from work in progress.
The replacement (one section, three parts)
loaded before the first tool call; pasted, head-anchored evidence; durable inputs; the
pre-validator self-audit before the first push.
same task; cap the fan-out; do the bounded fix yourself; continue a worker's own PR via
its session unless it finished/stalled.
(commit / PR / merge / tag / measured output); cadence (steady tool calls) = working,
give it room; loop (same failing action, no artifact change) = the pathology.
Rotate/take over ONLY on re-brief thrash (>2 orchestrator re-briefs of the same task),
idle-past-window with no artifact, or a repeated failing action. Never on turn count.
Diagnose from the transcript (
session_messagerows withtype='assistant'; tool mix;last actions).
How tested
Documentation-only (prose). Verified the whole file is intact and the bad trigger is gone:
Rulebook compliance
/charly-internals:agentsis the owning skill for this surface.N/A — documentation only; this REMOVES the workaround (the magic number).N/A — documentation only.Agent:
coordination· sessionses_f26225bfffferfo4tnJQw1ePqMAssisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)