Skip to content

fix(orchestrator): preserve task-step elapsed time across restart - #10051

Draft
saphid wants to merge 388 commits into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:work/v2-main-sync-20260905
Draft

fix(orchestrator): preserve task-step elapsed time across restart#10051
saphid wants to merge 388 commits into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:work/v2-main-sync-20260905

Conversation

@saphid

@saphid saphid commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Completed task steps lose their elapsed times when the V2 ingestor or client restarts. This PR persists server-derived step timing and carries it into the web/desktop task list, keeping repeated labels independent by stable step ID.

Head 4167fee60 is based on current V2 fdfadf3d0. Timing reads fetch only the matching plan record rather than loading thread history. Optional fields preserve compatibility with existing stored plans. Includes test-only prerequisite #10865; merge that first.

Validation: 53 focused tests across provider ingestion, turn control and session presentation pass, including restarted ingestion, repeated labels, and a guard against loading full thread history for timing. The focused tool-output retention prerequisite test passes. Server, web, mobile and contracts typechecks pass; scoped lint and formatting pass. Current-head visual proof remains pending.

This replaces the obsolete broad main/V2 reconciliation. Its main snapshot is already an ancestor of current V2. Mobile pending creation is present there (72 outbox tests pass), and the historical ledger fix is retained separately in #9900. The earlier tested head 61c87ae14 contained this timing behavior; the later f0b64d0c7 merge lost it. Both older heads were preserved before rebuilding this PR. No broader new-main merge is included.

The direct Claude Opus 5 high review launcher exited 1 on expired OAuth before inference; no independent Claude review occurred.

Implemented and verified with GPT-6 Astra in the Codex harness.

Test-only prerequisite #10880 cancels pending animation-frame callbacks before restoring test globals. Its identical patch passes all 7 editable-file language tests, lint and formatting; this addresses the CI teardown exception. Merge #10865 and #10880 first.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Sep 5, 2026
Comment thread apps/web/src/components/chat/composerPromptHistory.ts
Comment thread apps/server/src/persistence/Layers/ProjectionCheckpoints.ts Outdated
@saphid
saphid marked this pull request as ready for review September 5, 2026 08:52
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at c238f5c

Macroscope's review found this PR approvable — This is a focused orchestration bug fix that durably carries per-step elapsed times through ingestion and restart, using optional schema fields and a targeted plan lookup. Existing composer rendering is reused, and tests cover restart persistence and repeated labels without introducing deployment, security, billing, or configuration changes.

You can add or adjust custom eligibility rules. Learn more.

@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

Comment thread apps/server/src/terminal/Manager.ts
Comment thread apps/server/src/orchestration-v2/AgentSessionImportSources.ts Outdated
Comment thread apps/web/src/components/onboarding/WelcomeWizard.tsx Outdated
Comment thread apps/server/src/ws.ts Outdated
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from 9242b91 to 3d81172 Compare September 8, 2026 03:31
@saphid
saphid force-pushed the work/v2-main-sync-20260905 branch from 61c87ae to 86e4283 Compare September 8, 2026 04:40
juliusmarminge and others added 12 commits September 7, 2026 23:12
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- Re-route steering that races completion into idempotent follow-up dispatches
- Preserve scheduled-task attribution and provider ownership history across clients
Port main's pull-request discovery, active thread ordering, async question dismissal, settlement fixes, provider-session import, attachment context, and provider correctness changes into orchestration v2.

Keep the branch's intentional composer and subagent behavior while adopting main's web and mobile fixes. Prevent headless setup terminals from hanging on the color probe, and move the v2 migration block to 050-061 after main claimed 048-049.
Restore the failed-before-start timer guard, align two server fixtures with the reconciled behavior, and remove dead files, exports, and dependencies surfaced by Knip.

Drop the temporary branch push trigger now that the PR is mergeable, so each update runs the pull-request workflow once.
Keep main's batch machine-update banner and update action while preserving the v2 runtime-based environment lock used by draft load balancing.
Adopt TypeScript 7 and Effect rc.112 across orchestration v2, including the TaggedError API migration and updated Effect-aware tests. Restore main's composer-aware scroll-to-end clearance while retaining selected-model settings sync, preview recording transfer, image galleries, desktop context menus, and layout hit targets. Regenerate the lockfile on the upgraded dependency baseline.
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from efd9994 to 6102d00 Compare September 8, 2026 06:23
juliusmarminge and others added 8 commits September 8, 2026 14:26
Advertise bounded socket snapshots and authoritative dispatch validation, omit raw command output and inline file bodies at the wire boundary, and preserve compact status metadata across web and mobile. Add transport-budget coverage for snapshots, resume, commands, legacy import, and projection maintenance.
Restore pinned-thread shelf classification, server-owned unread state, hidden-subagent-safe project ordering, guarded jump hints, draft upload cleanup, and active-provider archive guards across the current and legacy sidebars.

Bring the surrounding current-main sidebar work forward as well: canonical project favicons, stable row layout, thread file drops, account-aware mobile provider badges, and deferred desktop keyring loading.
@saphid
saphid force-pushed the work/v2-main-sync-20260905 branch from f0b64d0 to c238f5c Compare September 9, 2026 03:34
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Sep 9, 2026
@saphid saphid changed the title chore(orchestrator): reconcile current main with V2 fix(orchestrator): preserve task-step elapsed time across restart Sep 9, 2026
@saphid
saphid marked this pull request as draft September 9, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants