Commit Graph
2462 Commits
Author SHA1 Message Date
Shivam SharmaandClaude Fable 5 c0a38525ea fix(orchestration-v2): preserve subagent progress state
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-04 01:08:29 +05:30
T3 Code TestandClaude Fable 5 3f82967507 test(persistence): cover renumbered subagent observability migration
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-04 01:08:29 +05:30
T3 Code TestandClaude Fable 5 bcbab62dc1 fix(orchestration-v2): address subagent observability review findings
- Treat pending/waiting workflow agents as active in the session-registry
  write guard and wake-buffer pre-open, so concurrent active transitions
  are not dropped and wake task_started cannot force a false resume.
- Preserve the first-recorded activation completion time on duplicate
  terminal frames (Claude in-place update and ACP rebuilt emits).
- Let a blocked/waiting first snapshot of a new attempt reopen a settled
  workflow agent entry instead of silently dropping its status and usage.
- Settle still-active workflow members when their coordinator
  terminalizes, and expect the Implementer completed in claude_workflow.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-04 01:08:17 +05:30
Shivam SharmaandClaude Opus 5 9c888b6b18 test(orchestration-v2): replay a Claude workflow end to end
The adapter's workflow projection was covered in isolation and the panel
derivation was covered against synthetic agents, but nothing drove real
workflow frames through the orchestrator to the projection the client
receives.

Adds a claude_workflow replay fixture: a local_workflow task with two
phases and two members, asserted on the resulting projection. Pins what
the panel groups by — that members claim declared phases, that their
membership points at the coordinator that actually reached the
projection, and that the coordinator's usage still covers its members
so subtracting theirs cannot go negative.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-04 01:08:17 +05:30
Shivam Sharma 3d4bf8d828 feat(orchestration-v2): populate subagent observability from providers
Fills in the data model added by the previous PR. Every adapter now
reports what its subagents are actually doing: role provenance, token
usage, recent activity, and per-activation records.

Usage needs two merge strategies because providers report it
differently. Codex sends cumulative snapshots per thread, so those merge
by maximum — duplicate and late out-of-order frames then leave the total
unchanged instead of inflating it. Claude reports per activation, so
lifetime usage accumulates only the delta since the previous snapshot.

A subagent identity is reusable, so completing an activation leaves it
at "idle" rather than "completed"; the timeline row for that activation
is still recorded as completed via the status mapping.

A Codex subAgentActivity frame carries no model of its own, so agents
registered from one were recorded with none at all — the common case for
Codex-native subagents, which then showed a role and a token count but
no model. They are recorded against the turn's model selection, which is
what they actually run on.

Three activation-lifecycle fixes in the Claude adapter, found in review:

- A resume that raced past settle was pre-opened by the wake buffer,
  which erased the terminal status the reopen check reads. The resume
  then reused the finished activation instead of starting a new one, so
  its ordinal stopped matching reality and its usage was measured
  against the previous activation's totals — clamping the delta to zero
  and silently dropping the resumed run's tokens. The pre-open now
  records that it happened, and the reopen check honours it.
- A replayed "waiting" frame could resurrect a settled subagent; only
  pending/running were guarded before.
- A duplicate terminal frame re-stamped completedAt, drifting the
  recorded completion time. Codex already preserved it; Claude now
  matches.

Reuse across runs is deliberately not addressed here — a subagent row
still carries the run it was spawned under. That is the next PR.
2026-08-04 01:08:17 +05:30
Shivam Sharma bbbeafa853 test(mobile): include subagent activations in cached projection 2026-08-04 01:08:02 +05:30
Shivam SharmaandClaude Opus 5 06829caa73 refactor(orchestration-v2): hoist the new schema decoders to module scope
The lint rule the CI Check job enforces flags a compiled decoder rebuilt
on every call. The activation payload decoder and the subagent decoders
this PR added were inline, which took the branch from the base's 67 lint
warnings to 73 and failed the job.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-04 01:08:02 +05:30
Shivam SharmaandClaude Opus 5 074c0c183f refactor(orchestration-v2): drop the redundant subagent observability backfill
Every observability field the migration backfilled carries a decoding
default equal to the value it wrote, so pre-upgrade rows already read
back correctly without it. The projection schema version bump also
fails startup verification, which deletes and replays those rows from
the event log before anything reads them.

Pin both halves: a contracts test decodes a stored payload missing all
eight fields through the schema the projection actually uses, and the
migration test asserts an existing row survives byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-04 01:08:02 +05:30
Shivam Sharma c1929c2b5b feat(orchestration-v2): add subagent observability data model
Introduces the schema, storage, and migration for richer subagent
tracking. Nothing produces the new data yet — adapters populate neutral
defaults so every subagent row remains valid — which keeps this change
reviewable as a pure data-model step.

Contracts gain a reusable subagent identity: per-activation records
(SubagentActivationId, OrchestrationV2SubagentActivation), cumulative
usage, a role, recent activity, and workflow grouping. A subagent may
now also rest at "idle" between activations.

Because a subagent status is not a turn item status, the two are bridged
by an explicit mapping rather than a copy. The Record type makes that
total: adding a subagent status without giving it a timeline meaning is
a compile error. Without it, a producer can emit a turn item whose own
schema cannot decode it, which is unrecoverable — the projection rebuild
then fails on every subsequent startup and the server cannot boot.

Migration 043 backfills existing rows so old events stay readable. Its
riskiest path is a partially-migrated row, where already-present JSON is
round-tripped through COALESCE; a test pins that structured values keep
their JSON subtype rather than being rewritten as quoted strings.

Also narrows event-envelope attribution in ProviderEventIngestor: a
payload carrying an explicit null run or node id now keeps that null
instead of inheriting the ambient run. Activations legitimately have no
run id, and the envelope is persistence metadata only — routing reads
payload fields — but this does change stored metadata for existing
event types that already pass explicit nulls.
2026-08-04 01:08:02 +05:30
maria-rcks 378615bb51 fix: reconcile rebase with latest main 2026-08-03 12:01:21 -04:00
Julius Marminge 8a3d81d52c fix(web): keep Git progress title anchored
- Prevent the title row from shifting when output is revealed
- Preserve panel and compact button sizing
2026-08-03 11:45:15 -04:00
Julius Marminge 87ff166fa0 fix(web): remove elevated thread details panel styling 2026-08-03 11:45:15 -04:00
Julius MarmingeandClaude Fable 5 252ce04576 refactor(orchestration): split thread-not-sendable into typed errors
Effect service conventions: ThreadManagementThreadNotSendableError
carried an Archived/NoSteerableRun reason union and switched on
reason._tag inside the message getter. Modelled as two error classes
(ThreadManagementThreadArchivedError, ThreadManagementNoSteerableRunError);
both still map to the MCP thread_not_sendable failure code.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-03 11:45:15 -04:00
Julius MarmingeandClaude Fable 5 f22182942c fix(orchestration): promoted queued messages keep the queued_turn intent
The turn item materialized when a queued run is promoted was emitted
with inputIntent "turn_start", but the deterministic replay driver (and
the recorded queued_turn fixtures) expect "queued_turn" — the mismatch
stalled replay before the queued run could start, leaving run 1 waiting
and run 2 queued forever in all five queued_turn fixtures.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-03 11:45:15 -04:00
Yusuf Rawat 7a5cc479f5 fix(orchestration): thread visits no longer create activity loops (#5038) 2026-08-03 11:45:15 -04:00
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 607ddc3618 perf(web): keep timeline minimap animations off the main thread
A renderer performance trace showed the minimap strips as a standing
source of main-thread frame work: each strip transitioned
background-color (paint) and width (layout), and both fire constantly —
scrolling or streaming flips a band of in-view states at once, and the
hover fisheye animates several widths at a time — so any interaction
kept a 60fps style/layout/paint pipeline running.

The strip now animates only compositor-friendly properties: width tiers
are scale-x on a fixed-width box, and the in-view highlight is a bright
overlay faded with opacity. The scroll handler also skips no-op
data-in-view attribute writes, which previously re-dirtied style state
for every strip on every scroll tick.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-03 11:45:14 -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 Marminge f29edafe04 fix(chat): prevent stale timeline scroll and rerenders
- Disable LegendList end-maintenance that could snap after user scrolling
- Cancel stale imperative scrolls and release settled turn anchors
- Stabilize handoff run data to avoid per-event timeline rerenders
2026-08-03 11:45:13 -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 Marmingeandcodex 413089399d [codex] feat(web): show git progress in the commit button (#4963)
Co-authored-by: codex <[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 b6577a862a fix(mobile): label queued message intent
Distinguish queued and steering user messages in the mobile thread feed, matching the web timeline.

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 5ded72aba2 fix(mobile): gate thread controls on live runs
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 6a803d092d fix(client): preserve live thread relationships
Co-authored-by: codex <[email protected]>
2026-08-03 11:45:12 -04:00
Julius Marmingeandcodex 45b8157e53 fix(web): enforce secure provider field defaults
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