GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(web): auto-reconcile external agent sessions on project open by lewismarshall · Pull Request #10386 · pingdotgg/t3code

Conversation

@lewismarshall

@lewismarshall lewismarshall commented Sep 6, 2026

Copy link
Copy Markdown

What Changed

Added always-on automatic reconciliation of external agent sessions (Claude Code, Codex) when projects become available on a connected environment.

A new useAgentSessionAutoReconcile hook is mounted in the chat layout route. When environment shells bootstrap, it calls the existing idempotent agentSessions.import RPC for every known project, surfacing agent work already on disk in the thread list — without requiring a manual "Import agent sessions…" action.

Related Ideas discussions:

  • [Feature]: First-class interop/sync between T3 threads and local Claude Code CLI sessions #6994
  • request: import or recreate sessions from Codex #6680

Why

When connecting to a remote environment via T3 Connect, agent sessions already on disk (e.g. Claude CLI history under ~/.claude) do not appear in the project thread list unless the user manually triggers an import. The existing AgentSessionScanner + AgentSessionImporter infrastructure (#5362) handles the heavy lifting, but is only wired into the first-run Welcome Wizard. Post-onboarding, there is no continuous visibility path.

This PR adds the minimal client-side trigger to close that gap. It reuses the existing server-side import RPC, which is fully idempotent (thread IDs are prefixed with import:, and per-source file-identity watermarks prevent re-reading unchanged transcripts).

What shipped

  • useAgentSessionAutoReconcile hook: watches the project list, triggers agentSessions.import once per project per mount cycle
  • selectUnreconciledProjects pure function: extracted for testability
  • Hook mounted in ChatRouteLayout (_chat.tsx)
  • Unit tests for the selection logic

Out of scope

  • Connect-cloud / account-wide session inbox
  • Live attach to running claude --remote-control
  • Cross-environment merged thread list
  • Settings toggle (import is already idempotent and silent)

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI chrome — invisible background reconciliation

Maintainer manual QA checklist

  1. Open existing project whose workspaceRoot matches agent session cwd on disk
  2. Without using the Import UI, external sessions appear (or appear shortly after open) with history
  3. Re-open / re-reconcile does not duplicate import: threads
  4. Opening a thread does not auto-start a provider turn
  5. Mismatched expectedWorkspaceRoot fails clearly / skips safely
  6. No claim of live remote-control attach — transcript history only

Test commands (run in repo)

npx vp test run apps/web/src/hooks/useAgentSessionAutoReconcile.test.ts
npx vp test run apps/server/src/project/AgentSessionImporter.test.ts
npx vp test run apps/server/src/project/AgentSessionScanner.test.ts
npx vp run --filter web typecheck

Refs: #6994, #6680

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cursoragent @lewismarshall
feat(web): auto-reconcile external agent sessions on project open
f667978
When environment shells bootstrap, automatically import external Claude
Code and Codex sessions for every known project. This surfaces agent
work already on disk in the thread list without requiring a manual
"Import agent sessions…" action.

The new useAgentSessionAutoReconcile hook reuses the existing idempotent
agentSessions.import RPC. Each project is reconciled once per mount
cycle; failures are silently ignored since a missing agent home is not
actionable for the user.

Refs: pingdotgg#6994, pingdotgg#6680

Co-authored-by: Lewis Marshall <[email protected]>
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds an always-on workflow that scans and imports external agent-session history for every known project when the chat experience starts, replacing a previously manual action. The new asynchronous production logic changes default runtime behavior and can create or update imported threads across projects.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the vouch:unvouched Author is not yet trusted in the VOUCHED list. label Sep 6, 2026
@cursoragent @lewismarshall
fix(web): classify and log auto-reconcile failures instead of swallowing
012680e
The original hook swallowed all import failures silently (.catch(() => {})),
making E2E debugging impossible when the server doesn't support the
agentSessions.import RPC (e.g. [email protected] predates PR pingdotgg#5362).

Changes:
- Add classifyImportFailure() that distinguishes four failure kinds:
  unsupported-server (RpcClientError), interrupted, expected domain
  errors, and unexpected defects.
- Log unsupported-server with a one-time console.warn naming the
  required server version and PR pingdotgg#5362. Skip further import attempts
  for that environment.
- Log expected errors (project not found, workspace mismatch, scan
  error, auth) with console.warn including project context.
- Log unexpected errors with console.error for debugging.
- Log successful imports with console.info when importedCount > 0.
- Add 10 new unit tests for classifyImportFailure covering all
  error classifications.

Co-authored-by: Lewis Marshall <[email protected]>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Sep 6, 2026
@cursoragent @lewismarshall
fix(web): only mark projects reconciled after definitive outcome
8ce7a76
selectUnreconciledProjects no longer eagerly adds keys to the reconciled
set. The hook marks a project reconciled only after:

- A successful import (importedCount + skippedCount returned).
- A definitive domain error (project not found, workspace mismatch,
  scan error, auth error) — these won't resolve without user action.

Transient failures (unsupported-server, unexpected defect, interrupted)
leave the project eligible for retry on the next render cycle. This
fixes the scenario where imports fail against an old server (pre-pingdotgg#5362)
and the project is permanently marked done, preventing retry after a
server upgrade without a full client remount.

Also: console.info now logs for every successful import (even when
importedCount is 0) with projectId, workspaceRoot, and skippedCount
for E2E observability.

Co-authored-by: Lewis Marshall <[email protected]>
@cursor

cursor Bot commented Sep 6, 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge mentioned this pull request Sep 7, 2026
feat(orchestration-v2): import an existing Claude Code or Codex session by id, with two-way transcript sync #5499
Closed
@juliusmarminge juliusmarminge closed this Sep 7, 2026
@juliusmarminge

juliusmarminge commented Sep 7, 2026

Copy link
Copy Markdown
Member

Closing as part of the open-PR backlog sweep (wave 3).

Reason: Unsolicited always-on session auto-import feature

Reopen if this is still wanted and you’re willing to rebase onto current main.

lewismarshall reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor cursor Bot mentioned this pull request Sep 9, 2026
feat(web): auto-reconcile external agent sessions on project open lewismarshall/t3code#1
Open
@lewismarshall lewismarshall mentioned this pull request Sep 9, 2026
feat(web): auto-reconcile external agent sessions on project open #10969
Closed
4 tasks done
@lewismarshall

lewismarshall commented Sep 9, 2026

Copy link
Copy Markdown
Author

@juliusmarminge Thanks for the sweep note — still wanted on our side.

Rebased onto current main (clean, 3 commits, head 09f86ffa7) and opened a fresh PR since reopen of this closed one failed:

→ #10969

Happy to iterate there if you’d rather a different UX than always-on (e.g. settings-gated), but the Connect dual-machine + on-disk Claude history gap is still real for us and E2E-verified against a post-#5362 server.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 2, 2026
feat(threads): hand off Claude CLI conversations to T3 DJProspero1/t3code#1
Draft
feat(threads): hand off Claude CLI conversations to T3 #30341
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@lewismarshall @juliusmarminge @cursoragent
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.