Document session-continuity rules in AGENTS.md
opencode ends the turn when an assistant message contains no tool call, including analysis-only messages. Document the working fix (end bursts with a tool call or a final report, land work incrementally, resume without re-deriving) so every session inherits it.
This commit is contained in:
1 parent
e5f1b9d825
commit
1641dab505
1 file changed
+23
@@ -5,6 +5,29 @@ auto-loads this file as instructions, overriding the built-in defaults for
|
||||
this project. Custom agents in `.opencode/agents/` inherit these rules
|
||||
unless their own prompts say otherwise.
|
||||
|
||||
## Session Continuity (keep the agent loop alive)
|
||||
|
||||
opencode ends the turn whenever an assistant message contains no tool
|
||||
call — including messages that are pure analysis. Long reasoning bursts
|
||||
are welcome in this repo (they pre-catch errors and self-correct), but a
|
||||
burst that ends as analysis-only text silently stops the session
|
||||
mid-task. Past sessions documented this repeatedly ("the session
|
||||
stalled"; the working fix discovered there: "call tools frequently, keep
|
||||
thinking bursts short"). Keep the depth; change where the burst ends:
|
||||
|
||||
1. **Never end a turn with analysis-only text.** Every visible message
|
||||
must either issue a tool call or be a final report for a genuinely
|
||||
completed phase/task. When a thinking burst converges on a decision,
|
||||
act on it (read, edit, bash) in the same turn.
|
||||
2. **Land work incrementally.** Once a design decision is settled, write
|
||||
the code before analyzing the next one. Do not emit full-design
|
||||
essays in a single chat message; reasoning belongs in thinking tokens
|
||||
or committed docs, not in the transcript.
|
||||
3. **On a silent turn end, resume without re-deriving.** If the turn
|
||||
ended after an analysis-only message and the task is incomplete,
|
||||
pick up from the last settled decision — do not redo the analysis
|
||||
and do not ask the user whether to continue.
|
||||
|
||||
## Git Workflow
|
||||
|
||||
**Commit and push when reasonable.** When a change is complete and
|
||||
|
||||
Reference in new issue
Block a user