Commit Graph
1012 Commits
Author SHA1 Message Date
Julius MarmingeandClaude Fable 5 353f352c1e feat(orchestration): port thread title regeneration to the v2 runtime
Follow-ups from the main merge:

- Migration numbering: main's 035_ProjectionThreadTitleRegeneration is
  released and keeps its id; this branch's unreleased v2 migrations shift
  to 036-044 instead (a released migration can never be renumbered).
- thread.metadata.update accepts regenerateTitle: true arms an in-flight
  titleRegeneration marker on the thread payload (requestId + startedAt),
  a landing title or explicit false clears it. The marker projects onto
  thread shells and through the client-runtime shell model, so the
  sidebar's Regenerating state works unchanged.
- New ThreadTitleRegenerationService worker reacts to armed markers on
  the live domain-event stream (so ws, MCP, and mobile dispatches all
  behave the same): builds a newest-first conversation digest from the
  v2 projection (8k-char budget, retained attachments — ported from the
  v1 reactor), generates via TextGeneration, and lands the title with a
  follow-up metadata update. Failures clear the marker and log.
- The server advertises threadTitleRegeneration again, and the client
  updateThreadMetadata dispatches regenerateTitle-only updates.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-03 11:45:15 -04:00
Julius MarmingeandClaude Fable 5 bb12ad5e99 fix(relay): stop replaying the whole event store into the awareness relay
Live profiling of the built app (debugger pause inside the hot sqlite
call) showed AgentAwarenessRelay.publishThread grinding at ~8 full shell
snapshots per second after boot. Two causes:

- streamDomainEvents was eventSink.stream() with no cursor, which
  replays every stored event from genesis before going live — so each
  boot fed the relay the entire event history as fresh activity, and it
  queued a publish per activity-relevant event for hours. It now tails
  from the current high-water mark; the relay's startup snapshot publish
  already covers initial state, and the sink subscribes before reading
  the cursor so no live event is lost.
- publishThreadUnsafe materialized the full shell snapshot to find one
  thread; it now uses getThreadShell (archived/deleted map to the
  tombstone path exactly as the active-list lookup did).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-03 11:45:14 -04:00
Julius MarmingeandClaude Fable 5 b76a0919dc perf(orchestration): per-thread shell deltas, visit throttling, event compaction (#4971)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marminge 8b88bc70bf feat(orchestration): track provider retries and thread visits
- Project retry progress and recovery for Codex and Claude turns
- Sync thread completion markers through server-side visit timestamps
2026-08-03 11:45:13 -04:00
Julius Marminge 64d8fcd8b6 feat(server): surface legacy thread migration progress
- Publish migration lifecycle events during startup
- Show a web toast while legacy threads are restored
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex 099c78a119 fix: close failed provider adapter scopes
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex 9d5e81ba49 fix: preserve thread management failure semantics
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex 3ba2d0278b fix: address latest orchestration review findings
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex b4bc329f73 fix: preserve orchestration task identity
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex b65e09cdd8 fix: address orchestration review findings
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex d1fbf7d250 fix: address orchestration review findings
Use shared cache schemas, close the OpenCode abort race, and assert fixture collection sizes correctly.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex dcfd6c9848 fix(orchestrator): preserve migrated and nested history
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex e9e68f8a6c fix(server): preserve project mutation client errors
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex faa853a149 fix(orchestrator): validate rollback and search links
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex 96ae1a48f4 fix(orchestrator): close cancellation edge cases
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex 3cd87892c0 fix(orchestrator): decode direct Claude result blocks
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex 08be31c2e9 fix(orchestrator): validate replay edge cases
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00
Julius Marmingeandcodex cfc63a2022 fix(orchestrator): preserve terminal effect outcomes
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 2a408a8ced fix(orchestrator): preserve retryable effect failures
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 4f6fed549d fix(orchestrator): avoid replaying settled effects
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 2d309f1468 fix(worktrees): make handoff rollback atomic
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 03dde37679 fix(orchestrator): release stranded effect claims
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 7c9e146f4f fix(orchestrator): execute resolved runtime responses
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 9de147e306 fix(orchestrator): harden provider edge cases
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex bb2bdc93ab fix(orchestrator): handle fresh review edge cases
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex f1a331d7be fix(orchestrator): address late review findings
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex e29797b966 fix(checkpoints): retain thread-start baseline after failed runs
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 192b160428 fix(claude): preserve explicit model options
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 7aecec1ab1 fix(server): isolate deterministic attachment ids
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex c5aa1a244b fix(testkit): harden provider replay recording
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 563f03ef58 fix(acp): enforce task and permission invariants
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex eca5fd07e9 fix(orchestration): preserve imported conversation state
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex b6d7072140 fix(checkpoints): preserve valid run history
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 70f452ba3a fix(acp): discover final teardown descendants
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 0620dae3a4 fix(cursor): log close attempts before execution
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 396eb47419 fix(orchestration): cancel queued work on archive
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 6ab4ce9fe3 fix(orchestration): handle checkpoint-wait runs
Allow merge-back from provider-finished runs awaiting checkpoint capture while keeping waiting runs visible but non-interruptible in mobile.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 091a76003e fix(acp): make xai cancellation reliable
Cancel pending prompt completions without restarting ACP, and keep text-only monitor acknowledgements tracked as background work.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 3d1db82e1c fix(orchestration): preserve legacy schedule compatibility
Enforce the one-minute floor only on writes, clamp legacy execution intervals, and keep queued work protected from archive while reusing shared active-run derivation.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex a70b7acd83 fix(mobile): preserve active thread state
Keep executing runs visible when newer work is queued, expose provider errors in compact shells, and preserve mobile creation metadata for fork and merge operations.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 74f8c7ceed fix(orchestration): harden scheduled task startup
Reject scheduled task intervals below one minute and tear down the effect worker when awareness relay startup fails.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex 25463fe2b1 fix(orchestrator): schedule effects from durable deadlines (#4656)
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Julius Marmingeandcodex fe5df2b650 feat: migrate v1 state into orchestrator v2 (#4400)
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Mike Olsonandcodex b244cc81ce fix(claude): Settle positive task-notification results
A Claude V2 turn whose terminal SDK result carried origin.kind
"task-notification" had that result discarded, so the run stayed running
forever and every run queued behind it stalled. The drop is now limited to
results reporting zero model turns, which is what the stale debris the guard
was written for actually looks like.

ClaudeAdapterV2 dropped any task-notification-origin result unless the turn was
an agent/provider continuation. An app-owned delegated-task wake run is
agent/server, so its terminal results were discarded and finalizeActiveTurn
never ran. Any turn whose final result carries that origin hangs, not just
wakes. Observed in production against a real session: three terminal success
results with num_turns 154, 60 and 7 were all dropped, the session went silent
for 8h27m, and five queued runs behind it never dispatched.

The guard could not simply be deleted. After interrupt recovery a stale stopped
task_notification and its origin result interleave ahead of the real root
assistant stream and must not terminalize the turn or leak their text.
Zero-turn results are still dropped, so that path is unchanged: this drops
strictly fewer results than before, so no previously working path can regress.

num_turns separates the two cases cleanly. The existing stale fixture sets
numTurns 0 explicitly, makeResultFrame defaults to 1, and the production
results all carried positive turns. The predicate is num_turns === 0 rather
than < 1 or a truthiness check on purpose: num_turns is required on both result
variants in 0.3.205, but if an older emitter ever omitted it, undefined === 0
is false, so the result is accepted rather than dropped. That fails toward
terminalizing rather than toward the hang class this fixes.

Both drops and accepts are logged with num_turns, stop_reason, terminal_reason,
result uuid, session id and message provenance. The drop is debug level because
interrupt recovery produces it routinely; the accept is info, because a
positive-turn task-notification result settling a non-continuation turn is both
the hang fix working and the exact shape a stale positive-turn result would
take.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Mike Olsonandcodex 5ee040a06e fix(orchestrator): Wake settled parents when delegated children finish
An app-owned delegated child wrote its result into the parent projection but
never started a parent run, so an async delegation's result sat unread until the
user's next message. Offer a provider continuation request when a delegated
child terminalizes, with a per-task completionWake policy separating async
delegations from blocking waits.

The wake must also reach the model. ProviderContinuationRequests is a
provider-native mechanism whose dispatch only triggers ingestion of output the
adapter already buffered, and both ClaudeAdapterV2 and AcpAdapterV2 discard the
message text when it is marked creationSource provider. An app-owned child
buffers nothing, so a wake marked that way settled instantly having prompted
nothing. App-owned wakes now dispatch as message_text via a shared
delegatedTaskWakeRequest helper used by both producers.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:11 -04:00
Mike Olson f691c18da4 fix(acp): Preserve wake evidence across an app-owned wake
This PR introduces the only wakeBuffer clear at the ACP startTurn site, and it
also clears midTurnUnreportedCompletedTaskIds there, both on the reasoning that
a user turn owns the conversation.

An orchestrator-injected wake is not a user turn. #4499
fix/delegated-task-parent-wake dispatches app-owned delegated-child wakes as
creationSource "server", which is non-continuation, so once both land such a
wake would discard this session's pending native wake frames and its kept
mid-turn completion marks, losing agent output and a continuation offer that
nothing else can recover.

acpIsAppOwnedWakeTurn exempts orchestrator-injected wakes from both clears,
matching what ClaudeAdapterV2 already does with its own buffer. Inert without
#4499, since nothing else dispatches creationSource "server". Kept as its own
commit because the concern originates in a different PR.
2026-08-03 11:45:11 -04:00
Mike Olson ead7f56c6d fix(grok): Prevent spurious wake run after in-turn monitors
- Defer continuation offers for background completions that land while a
  root turn is active and un-finalized; finalize offers exactly one wake
  only when unhandled completed work remains
- Stop late monitor-event mutations from erasing in-turn handled marks, so
  injected-turn ack chatter is never retained as wake evidence
- Clear stale wake buffer frames at non-continuation user-turn start
- Make the late-mutation suppress logic's running/terminal branches
  mutually exclusive
2026-08-03 11:45:10 -04:00
Julius Marmingeandcodex 55be8808d4 test(orchestrator): align merged V2 compatibility checks
Remove the unreferenced V1 activity payload projection that arrived from main and assert only the public serialized SchemaError shape under Effect beta.102.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:10 -04:00
Julius Marmingeandcodex 134d0b62ba fix(server): clean up Claude replay failures
Wake replay stream waiters when outbound validation fails and ensure interrupted recordings close when no tool use arrives.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:10 -04:00
Julius Marmingeandcodex f52e8be137 fix(server): enforce ACP auth and preserve fork provenance
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:10 -04:00