Improve project action terminal readiness#3175
Open
Quicksaver wants to merge 286 commits into
Open
Conversation
Filter dependencies during packaging to include only necessary modules, reducing bundle size and potential issues. Allow "./" as a valid base URL for web builds, making configuration more flexible and developer-friendly.
- Add desktop bootstrap MCP server plumbing - Wire host integration through server config - Project Codex bridge events into the VS Code extension - Tighten message timeline row derivation
- Add stdio-to-uds relay for provider MCP clients - Pass host MCP metadata into Claude, Cursor, and OpenCode - Update MCP docs for provider-specific configuration
- Keep conversation locks outside the webview composer\n- Allow the composer picker to switch providers in VS Code\n- Cover the new lock resolution behavior with unit tests
- Clean up stdio relay socket lifecycle - Clamp OpenCode MCP timeouts and skip invalid values - Improve VS Code MCP timeout docs and tests
- Share MCP timeout normalization across server and VS Code - Reject invalid bootstrap timeout values at schema boundary - Harden VS Code MCP bridge message handling and cleanup - Document the command allowlist and timeout minimum
- Re-export the minimum from shared MCP helpers\n- Keep desktop bootstrap schema as the source of truth
- Read allowlist from t3code.mcp.allowedRunCommands - Keep default commands and prefix matching - Update docs and tests for custom patterns
- Cache parsed patterns until t3code setting changes - Reject malformed allowlist entries and dedupe valid ones - Update schema and tests for config refresh and validation
- Resolve allowlist directly from workspace config - Drop cache invalidation listener and cached state
- Allow activateExtension on vscodeRunCommand - Activate installed extensions before registration checks - Cover activation and validation cases in tests
- Check contributed commands before activating an extension - Fail fast when the requested command is not declared - Cover the new guard with a rejection test
- Gate activateExtension behind a new allowlist - Update MCP bridge behavior and validation - Document and test the new setting
- Advertise VS Code MCP bridges from the extension\n- Discover and probe matching host MCP servers on startup\n- Preserve security checks and add cleanup for stale records\n- Cover advertisement and discovery flow with focused tests
- Advertise VS Code backends in shared local files - Route live owner commands through local peer APIs - Merge peer events into desktop shell and thread streams
- Fall back to bootstrap servers on discovery failures - Treat Windows named pipes as probe-validated - Add regression coverage for provider-start fallback
- Accept dispatchable thread.turn.start payloads in local peer HTTP - Export the dispatchable command schema for shared decoding - Cover normalized attachment IDs in contract tests
- Share advertisement file helpers across host and backend flows - Reject non-loopback peer URLs and tighten local-peer request handling - Add fallback paths and tests for discovery and route authorization
- Query peers sequentially until one returns a result - Avoid sending owner-sensitive commands to later peers - Cover the interrupt dispatch path with a regression test
- Align VS Code extension deps with the upstream Effect catalog - Switch local peer HTTP calls and server tests to Effect HTTP - Tighten orchestration test decoding for thread.turn.start
- Resolve catalog dependencies from the root workspace catalog - Keep packaged VS Code manifests installable outside the monorepo
- Add forceDesktopLayout to sidebar provider - Keep thread sidebar open in desktop shells - Add regression coverage for desktop rendering
- Preserve provider lock in all hosts - Remove VS Code-only composer unlock path - Update unit coverage for shared lock behavior
- Buffer and coalesce subagent activity output - Preserve local behavior for future upstream merges - Document branch-specific changes in CUSTOMIZED.md
- Let chat surfaces use full available width by default - Keep the VS Code setting as an explicit opt-in override - Cover the new default with a focused web test - Update extension docs to describe empty as no max width
- Label desktop-bootstrap bearer sessions as VS Code - Shorten their bearer TTL and revoke stale ones - Add authenticated session revocation on backend stop - Route thread archive stop commands through peer context - Update tests for auth, federation, and backend cleanup
- Remove the 12-hour TTL override for backend bearer sessions - Keep stale desktop-bootstrap cleanup separate from live tokens
- Restrict self-revoke route to bearer sessions - Make backend revocation timeout portable and resilient - Preserve peer archive-stop routing fallback
- Stop provider sessions when archive routing lookup fails - Add regression coverage for lookup failure fallback
- Add bearer-only HTTP authentication for revocation - Cover revocation when cookie and bearer auth coexist
- Add YAML manifests for worktree comment, port, spawn, and update skills - Disable implicit invocation for each new agent skill
- State that subagents only need branch-local step context - Remove instructions to share overall process status
# Conflicts: # apps/desktop/src/backend/DesktopBackendManager.ts # apps/server/src/auth/SessionStore.test.ts # apps/server/src/provider/Layers/CodexSessionRuntime.test.ts # apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.test.ts # apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts # apps/server/src/sourceControl/GitLabCli.ts # apps/web/src/environments/primary/auth.ts # apps/web/src/environments/primary/target.ts # apps/web/src/hooks/useTheme.ts # packages/effect-acp/src/client.test.ts # packages/effect-acp/src/protocol.test.ts
- Route provider failures through shared sourceControlProviderError - Rename host bootstrap helpers to desktop-managed compatibility names - Add typed project-action terminal readiness errors and tests
- Sanitize provider error causes and URL diagnostics - Treat terminal closure as strict readiness failure - Add source-control test alias and compatibility comments
- Add fallback userinfo stripping for unparseable embedded URLs - Cover malformed embedded URL sanitization
- Preserve latest running child activity rows in parent timelines - Add per-generation sidebar indentation for visible subagents - Update subagent dedupe and visibility tests
…ed-project-actions # Conflicts: # apps/server/src/terminal/Layers/Manager.ts # apps/server/src/terminal/Manager.test.ts
…-project-actions # Conflicts: # apps/server/src/terminal/Manager.test.ts # apps/server/src/terminal/Manager.ts # apps/web/src/components/ChatView.tsx # apps/web/src/projectScriptTerminals.test.ts # apps/web/src/projectScriptTerminals.ts
- Return readiness errors without retrying malformed payloads - Dispose VS Code webview resources if setup fails - Escape injected inline script content and tighten work log parsing
- Release transient server resources before socket cleanup
- Retry stalled readiness body reads after abort timeout - Cover stalled JSON readiness bodies before bootstrap
- Sanitize bootstrap errors and preserve cleanup failures - Split malformed readiness from transient body read failures - Cover script escaping and ambiguous output prefix merges
- Append prefix-matching tool updates for multiline output - Cover multi-character prefix chunks in session-log tests
- Keep multiline tool.updated snapshots from reappending prefix chunks - Update regression tests for shorter multiline snapshot updates
- Keep one-character prefix snapshots from duplicating output - Update session-log coverage for the snapshot case
- Append prefix-shaped incremental command output updates - Restore regression coverage for prefix chunk merging
- Keep multiline tool.updated snapshots from duplicating output - Update tests to cover shorter prefix snapshots
- Remove the unconditional multiline prefix snapshot override - Update the command output merge regression test
…ed-project-actions # Conflicts: # apps/server/src/provider/Layers/CursorProvider.test.ts # apps/web/src/components/AppSidebarLayout.tsx # apps/web/src/components/NoActiveThreadState.tsx # apps/web/src/components/Sidebar.tsx # apps/web/src/components/chat/ChatHeader.tsx # apps/web/src/components/ui/sidebar.tsx # apps/web/src/routes/_chat.index.tsx # apps/web/src/routes/settings.tsx
…ed-project-actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This branch tracks the terminal-backed project action work after syncing with the fork's current
mainand then merging the latestupstream/main. The production behavior is already present onorigin/main; the remaining branch-local delta now includes upstream PR review fixes for VS Code bootstrap/webview safety and command-output merging, test compatibility cleanup inapps/server/src/terminal/Manager.test.ts, one focused project-action terminal readiness hardening patch, and the latest upstream mainline merge.The underlying project action behavior still routes actions through stable action-specific terminals, waits for the selected terminal to be input-ready before writing, avoids busy terminals when choosing a target, and keeps POSIX subprocess detection conservative when process-tree inspection cannot prove the shell is idle.
What Changed
action-*terminal IDs for project scripts, with numeric fallback suffix allocation when existing action terminals are busy.action-build-2.Action: build (2)so fallback instances do not collide visually with primary action terminals.psfallback behavior, and action terminal labels.Manager.test.tscompatibility by referencingTerminalManager.__testingthrough the existing namespace import and avoiding the unstableChildProcessSpawner.ExitCodeimport in test output helpers.Why
When running a custom action, the terminal can open and receive the inserted action before the shell is ready. Once the terminal later becomes ready, it may no longer be able to receive that action. The project action path therefore needs to wait for an input-ready prompt, reuse stable action terminals only when they are genuinely usable, and fail conservatively when terminal busy/idle state cannot be proven.
This branch is now mostly preservation and review history for behavior already carried by the fork's mainline, plus upstream PR review fixes, the small test/readiness compatibility deltas needed after the latest main sync, and the current upstream mainline merge.
No per-branch
CUSTOMIZED.mdis present. That merge-maintenance inventory is intentionally branch-local tomain.Validation
pnpm exec vp checkpnpm exec vp run typecheckpnpm exec vp test run apps/web/src/projectScriptTerminals.test.ts apps/server/src/terminal/Layers/Manager.test.ts packages/shared/src/terminalLabels.test.tspnpm exec vp test run apps/server/src/terminal/Layers/Manager.test.ts packages/shared/src/terminalLabels.test.ts apps/web/src/projectScriptTerminals.test.tspnpm exec vp test run apps/web/src/session-logic.test.ts apps/vscode-extension/src/backendManager.test.ts apps/vscode-extension/src/webview.test.ts apps/vscode-extension/src/mcpBridge.test.ts apps/vscode-extension/src/extension.test.tspnpm exec vp checkpnpm exec vp run typechecksession-logic,backendManager,webview, andmcpBridgetests plusvp checkandvp run typecheckafter the review-hardening commits.pnpm exec vp test run apps/web/src/session-logic.test.tspnpm exec vp checkpnpm exec vp run typecheckpnpm exec vp test run apps/web/src/projectScriptTerminals.test.tspnpm exec vp checkpnpm exec vp run typecheckReview Follow-up
psmock distinguish the direct child command lookup from the full process-table lookup.action-build:2renders differently fromaction-build-2.f4a01d8214347a69ced926fde34354e3dfd3aa12.origin/main; the current branch-local diff overorigin/mainis theManager.test.tstest compatibility cleanup described above.fd6a6d884,8bc52982,ade76fe93,490454e1, and8abfd42e, then ran the required CodeRabbit, Codex, Blast, final CodeRabbit, and final Codex assessment sequence for those changes.fc153e138, preserving shorter multiline prefix snapshots without dropping ambiguous one-character streamed chunks, then ran CodeRabbit, Codex, Blast, final CodeRabbit, and final Codex assessment passes.CUSTOMIZED.mdwas later removed from this branch in3046aa4a0because it is intentionally branch-local tomainonly.CUSTOMIZED.mdpath-reference thread without code or doc changes, becauseCUSTOMIZED.mdis absent from this branch.upstream/mainthrough6e48d8093; no additional validation was run because this was a merge-only PR metadata refresh.Proof
Note
High Risk
Touches orchestration persistence and provider interrupt paths for subagents, auth compatibility endpoints, and desktop backend discovery advertisements—areas where regressions affect thread lifecycle, security sessions, and multi-client connectivity.
Overview
This PR is a large fork/integration batch rather than a single feature: it wires Codex subagent lineage through orchestration projection (
parentRelation/ subagent columns on thread create/update and snapshot queries), child-thread runtime ingestion (shell creation, launch prompts, resume-to-running, title generation), and interrupt routing through the root provider session with explicit failure when no child turn exists.Host and desktop: Server config gains VS Code-oriented bootstrap fields (workspace folders, active folder key, host MCP servers,
hostIntegration), plust3 stdio-to-udsfor MCP stdio relay. Legacy HTTP routes restore bearer bootstrap and session revoke compatibility. Desktop backend runs now write and heartbeat backend advertisements int3Home, refresh them on readiness, and remove them on run finalization/stop (with a regression test). Electron context menus collapse duplicate leading/trailing separators.Docs and agent workflow: New maintainer docs (
SUBAGENTS.md,SOURCE_CONTROL.md,POWER_CONSUMPTION.md) and.agents/skills/*orchestration skills for updating/porting worktrees and addressing PR comments from parallel branches.AGENTS.mdnotes the fork andCUSTOMIZED.md.Misc: Auth/session test hooks (
deleteExpired, stale desktop bootstrap bearer cleanup policy),sanitizeErrorCausefor bounded diagnostics, mobile EAS owner/project id change,.gitignorefor*.vsix, and assorted mock/test harness updates (ACP/Codex cwd logging, integration text-generation layer ordering).Reviewed by Cursor Bugbot for commit 2a02f76. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add VS Code extension, source control panel, and subagent thread hierarchy support
apps/vscode-extension/) with a webview renderer,BackendManagerfor desktop backend connectivity, a Unix-socket MCP bridge, client settings persistence, and virtual workspace cache for GitHub virtual folders.SourceControlPanelServiceandSourceControlPanelUI with comprehensive VCS operations (staging, committing, pull/push, branch management, diff rendering), exposed via newvcsPanel*WebSocket RPCs and scoped by auth.ChatViewby reusing existing sessions when idle, waiting for readiness before sending input, and closing terminal UIs when terminals are disabled by host preferences.hostAppearance.ts,hostDisplayPreferences.ts) so VS Code webviews can override the app theme, fonts, and thread conversation width viawindow.t3HostBridge.projection_threads; migration 034 backfillsroot_thread_idfor existing rows, which may be slow on large databases.Macroscope summarized 6e48d80.