Commit graph

55 commits

Author SHA1 Message Date
Kit Langton
aa2c1472fa fix(core): copy the context checkpoint when forking a session
Copied fork messages keep their parent seqs, but a fresh checkpoint's
baseline_seq starts near zero, so nothing folded: forks received a new
full baseline plus every stale context-update message from the parent,
and copied compaction rows triggered a spurious rebaseline. Inheriting
the parent row keeps the fold horizon consistent with the copied
transcript.

Also asserts the checkpoint reset on committed reverts and deletes the
unused SessionStore.runnerContext / SessionHistory.loadForRunner
surface.
2026-07-02 21:21:11 -04:00
Kit Langton
cfdb9ab705 refactor(core): delete the system context registry
Builtins and instruction context become ordinary Location-scoped
services exposing load(), the same shape as skill, reference, and MCP
guidance. The runner composes all six producers explicitly in
loadSystemContext, so the full context roster is readable at one call
site. Dynamic registration and scoped deregistration had no consumers.
2026-07-02 21:21:11 -04:00
Kit Langton
67b4b2894f refactor(core): replace context epoch with a single-entry checkpoint
One prepare call per turn, before input promotion: it creates the
checkpoint when missing, rebaselines after completed compaction, and
otherwise narrates drift as a chronological update. The initialize/
prepare two-step and its redundant queries are gone, and context update
messages now precede the promoted user message.

An undecodable stored applied record heals by treating every source as
new instead of failing the drain; ContextSnapshotDecodeError is deleted.

Renames: SessionContextEpoch -> SessionContextCheckpoint. The SQL table
name and wire event type are unchanged.
2026-07-02 21:21:11 -04:00
Kit Langton
bf5294121a refactor(core): simplify system context to a belief model
Reconcile never rewrites the baseline; only rebaseline (compaction) and
initialize (first turn) produce baseline text. The durable Applied record
tracks what the model was last told, per source.

- Incompatible stored values re-announce the source baseline as an update
  instead of forcing a full replacement
- Sources removed without removal text retain the model's belief silently;
  entries self-clean at the next rebaseline
- Rebaseline restates unobservable sources from their last-applied values
  instead of blocking; ReplacementBlocked and ReplacementReady are gone
- Rename Snapshot to Applied and Generation to Baseline {text, applied}
2026-07-02 21:20:38 -04:00
Kit Langton
7d598b5610 refactor(core): drop synchronous drain start from the coordinator
Drains now uniformly start one tick after wake or run, removing the
ready-deferred release that ran the first drain synchronously inside
the caller. The synchronous start was observable only by tests that
asserted state immediately after fire-and-forget calls, coupling them
to scheduler internals; those tests now synchronize explicitly through
session.wait or stream-start signals.
2026-07-02 21:15:15 -04:00
Kit Langton
606de48d8b refactor(core): simplify prompt inbox promotion and projection
Remove the steer promotion cutoff: a turn boundary now promotes every
steer pending at promotion time instead of snapshotting the inbox at a
captured sequence, so late-arriving steers ride along into the turn.

Delete legacy projected-prompt synthesis from projectPrompted. The
event-sourced session input migration wiped pre-inbox event history,
so every Prompted event follows an admitted inbox row and a missing or
divergent row on replay is an invariant violation.

Inline the prompt equivalence predicate and update tests that seeded
history with bare Prompted events to publish PromptAdmitted first.
2026-07-02 16:46:16 -04:00
Kit Langton
0d1ef5adb6 fix(core): fail drains on tool output persistence failures
Restructure runner turn settlement: replace TurnTransitionError defect
control flow with tagged turn results and a plain restart loop, name the
settlement evidence, and merge duplicated interrupt branches.

Split settled tool-fiber failures: tool implementation defects keep
surfacing as model-visible tool errors and the turn continues, while
typed ToolOutputStore errors now fail the assistant and the drain
instead of being silently absorbed.
2026-07-02 16:19:46 -04:00
James Long
8c94e9005f
chore: merge dev into v2 (#34788)
Co-authored-by: Brendan Allan <14191578+Brendonovich@users.noreply.github.com>
Co-authored-by: Kit Langton <kit.langton@gmail.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Affan Ali <93028901+affanali2k3@users.noreply.github.com>
Co-authored-by: affanali2k3 <affanalikhanxx@gmail.com>
Co-authored-by: Frank <frank@anoma.ly>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <little-frank@opencord.local>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Jay V <air@live.ca>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Aarav Sareen <96787824+arvsrn@users.noreply.github.com>
Co-authored-by: OpeOginni <107570612+OpeOginni@users.noreply.github.com>
Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
Co-authored-by: Ben Guthrie <benjee.012@gmail.com>
Co-authored-by: Dax <mail@thdxr.com>
Co-authored-by: Filip <34747899+neriousy@users.noreply.github.com>
Co-authored-by: Max Anderson <max.a.anderson95@gmail.com>
Co-authored-by: Brendan Allan <git@brendonovich.dev>
Co-authored-by: Jack <jack@anoma.ly>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
Co-authored-by: Dustin Deus <deusdustin@gmail.com>
Co-authored-by: starptech <starptech@starptechs-MBP.fritz.box>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: usrnk1 <7547651+usrnk1@users.noreply.github.com>
Co-authored-by: Jay <53023+jayair@users.noreply.github.com>
Co-authored-by: runvip <164729189+runvip@users.noreply.github.com>
Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: Julian Coy <julian@ex-machina.co>
Co-authored-by: Vladimir Glafirov <vglafirov@gitlab.com>
2026-07-01 17:12:00 -04:00
Dax Raad
fb884bb91e feat: update session notices and skill reloads 2026-07-01 14:37:27 -04:00
Dax Raad
5710064ae1 feat(core): generate session titles from first prompt
Add SessionTitle service that generates a session title from the
session's sole user message via the customizable "title" agent, then
renames the session. Runs once per session, gated on durable history
having exactly one user message (no default-title string comparison).

Wire it into SessionRunner as a background fork after the first turn's
prompt promotion makes the user message visible; forking before
promotion caused the first-message lookup to see zero rows and silently
no-op.

Closes #34364
2026-07-01 11:07:44 -04:00
Kit Langton
194b0615e0
feat(plugin): support plugin-provided tools (#34619) 2026-06-30 13:18:56 -04:00
Aiden Cline
b1ca070b3b
feat(core): add mcp support (#34513) 2026-06-30 08:37:44 -05:00
Dax Raad
02cb350880 feat(tui): refresh agents after update events 2026-06-30 00:18:26 -04:00
Kit Langton
7073e8797f
fix(core): remove per-prompt system option (#34361) 2026-06-28 21:56:59 -04:00
Kit Langton
f7034a35a8
feat(core): add v2 manual compaction (#34336) 2026-06-28 21:18:19 -04:00
opencode-agent[bot]
6067019434
fix(core): restore v2 model prompts (#34275)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
2026-06-28 14:47:20 -05:00
Kit Langton
04c6bed240
feat(core): restore per-request system prompt (#34335) 2026-06-28 14:02:46 -04:00
Kit Langton
94e3a29d2f
feat(core): wire v2 subagent tool (#34320) 2026-06-28 12:52:39 -04:00
Kit Langton
41283933ff
chore: merge dev into v2 (#34317)
Co-authored-by: Brendan Allan <14191578+Brendonovich@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Affan Ali <93028901+affanali2k3@users.noreply.github.com>
Co-authored-by: affanali2k3 <affanalikhanxx@gmail.com>
Co-authored-by: Frank <frank@anoma.ly>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: James Long <longster@gmail.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Jay V <air@live.ca>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Aarav Sareen <96787824+arvsrn@users.noreply.github.com>
Co-authored-by: OpeOginni <107570612+OpeOginni@users.noreply.github.com>
Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
Co-authored-by: Ben Guthrie <benjee.012@gmail.com>
Co-authored-by: Dax <mail@thdxr.com>
Co-authored-by: Filip <34747899+neriousy@users.noreply.github.com>
2026-06-28 11:30:38 -04:00
Dax Raad
b6553d14e1 fix(core): fail interrupted session steps 2026-06-27 01:16:30 -04:00
Dax Raad
6a16c41e8f fix(core): continue after tool defects 2026-06-26 22:02:30 -04:00
Kit Langton
ef5c9f4931
feat(sdk): expose active sessions (#33991) 2026-06-26 03:33:35 +00:00
Dax
9bb5370205
feat(core): add session snapshot and revert system (#33226) 2026-06-24 23:41:16 +00:00
Kit Langton
516cfe4e09
refactor(schema): extract shared public schemas (#33571) 2026-06-23 22:31:06 -04:00
Kit Langton
dc468bdcfd
fix(core): reset steps for promoted prompts (#33452) 2026-06-22 19:01:14 -04:00
Kit Langton
f48f24ec4e
refactor(core): simplify session input promotion (#33443) 2026-06-22 17:51:49 -04:00
Kit Langton
fe840d42b8
refactor(core): simplify session run coordination (#33388) 2026-06-22 12:16:30 -04:00
Kit Langton
c6ee511485
refactor(core): simplify session context epochs (#33378) 2026-06-22 11:34:03 -04:00
Dax
2bb4311042
refactor(core): simplify integration test fixtures (#33292) 2026-06-22 04:15:34 +00:00
Kit Langton
49593c1ec4
fix(core): settle interrupted assistant steps (#33266) 2026-06-21 20:22:09 +00:00
Dax
fb43c15f88
refactor(core): simplify event model (#33238) 2026-06-21 10:34:57 -04:00
Dax
c780d7cee7
feat(plugin): add v2 effect host (#33111) 2026-06-21 08:05:49 -04:00
Kit Langton
4f1ae1604e
chore: upgrade Effect to beta 83 (#32340) 2026-06-20 19:57:29 -04:00
Kit Langton
4f1a9d7aef
fix(core): honor configured agent step limits (#33142) 2026-06-20 23:04:30 +02:00
Dax
8a2cfc00c9
feat(core): add project reference guidance (#31601) 2026-06-10 04:08:26 +00:00
Dax
132ef57272
refactor(core): simplify location filesystem (#31545) 2026-06-09 14:28:45 -04:00
Dax
fe0c4f8c74
refactor(server): canonicalize service API (#31049) 2026-06-07 03:27:28 +00:00
Kit Langton
eb9a683b40
fix(core): harden unified tool runtime (#31171) 2026-06-06 21:55:34 -04:00
Kit Langton
660a00d317
refactor(core): unify v2 tool architecture (#31168) 2026-06-06 20:49:12 -04:00
Kit Langton
747b8daafc
fix(core): bound prompt cache session keys (#31062) 2026-06-06 08:00:16 -04:00
opencode-agent[bot]
7c6adcf60f
fix(core): scope v2 prompt cache by session (#31036)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
2026-06-05 19:11:32 -04:00
Kit Langton
820c984d47
fix(core): recover v2 context overflow (#31005) 2026-06-05 16:05:51 -04:00
Kit Langton
a9094fd059
feat(core): bound v2 tool output (#30999) 2026-06-05 14:35:19 -04:00
Kit Langton
beae7290f3
feat(core): compact v2 session context (#30986) 2026-06-05 13:17:23 -04:00
opencode-agent[bot]
f26a9e8856 chore: generate 2026-06-05 16:08:20 +00:00
Kit Langton
12e38866ed
feat(core): interrupt v2 session execution (#30850) 2026-06-05 16:06:40 +00:00
Kit Langton
3f64b5e621
feat(core): admit v2 skill guidance (#30843) 2026-06-05 11:19:55 -04:00
opencode-agent[bot]
e9aa33d4bd chore: generate 2026-06-05 14:49:06 +00:00
Kit Langton
02a5ae6585
fix(core): respect v2 default agents (#30969) 2026-06-05 10:47:31 -04:00
weiconghe
a261b55e43
fix: use mapError instead of orDie for context snapshot decoding (#30905)
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
2026-06-05 18:07:00 +05:30