You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DescriptionTwo problems that compound each other during multi-session debugging sessions.## Problem A — Hypothesis loop detectionWhen debugging a test failure, the model often proposes a hypothesis, changes code, runs tests, sees the same failure, and proposes a new hypothesis — all at the source-code layer. It never descends to examine evidence (logs, core dumps, network traces) because nobody tells it to.opencode sits between the model and the tools. It can detect when the model has made N attempts at the same layer without success and intervene with a suggestion to go deeper.## Problem B — Cross-session memoryEvery new session re-reads files already read in the previous session. Same files, re-read multiple times across sessions debugging the same CI failure. This wastes context and time.## Proposed SolutionProblem A: Add a hypothesis tracker to the conversation loop:- Track (hypothesis text hash, layer indicator) pairs per conversation- After 2 falsified hypotheses at the same layer, inject a system message: "You have tested 2 hypotheses at the source-code layer without success. Consider examining the actual evidence: logs, core dumps, strace output."- This is purely an opencode loop-level feature — the model doesn't need changesProblem B: Add a .opencode/session.json cache:- On session end, write: branch name, goal description, list of files read with their mtime- On session resume with the same branch, skip re-reading files whose mtime hasn't changed- Also track the last hypothesis so the model can pick up where it left off- This is an opencode session management feature## Verification- [x] I have checked that this feature has not been suggested before
DescriptionTwo problems that compound each other during multi-session debugging sessions.## Problem A — Hypothesis loop detectionWhen debugging a test failure, the model often proposes a hypothesis, changes code, runs tests, sees the same failure, and proposes a new hypothesis — all at the source-code layer. It never descends to examine evidence (logs, core dumps, network traces) because nobody tells it to.opencode sits between the model and the tools. It can detect when the model has made N attempts at the same layer without success and intervene with a suggestion to go deeper.## Problem B — Cross-session memoryEvery new session re-reads files already read in the previous session. Same files, re-read multiple times across sessions debugging the same CI failure. This wastes context and time.## Proposed SolutionProblem A: Add a hypothesis tracker to the conversation loop:- Track (hypothesis text hash, layer indicator) pairs per conversation- After 2 falsified hypotheses at the same layer, inject a system message: "You have tested 2 hypotheses at the source-code layer without success. Consider examining the actual evidence: logs, core dumps, strace output."- This is purely an opencode loop-level feature — the model doesn't need changesProblem B: Add a
.opencode/session.jsoncache:- On session end, write: branch name, goal description, list of files read with their mtime- On session resume with the same branch, skip re-reading files whose mtime hasn't changed- Also track the last hypothesis so the model can pick up where it left off- This is an opencode session management feature## Verification- [x] I have checked that this feature has not been suggested before