fix(start): resolve the launch cwd through the single transport-aware owner - #151
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All 14 gates now pass (1 skipping), For the record:
Tracked separately in #152 with the evidence and the ruled-out hypotheses, rather than fixed here — it is unrelated to this change and would widen the diff. |
… owner Starting a session with the Unclassified project always failed: StartViewModel resolved the launch cwd via ProjectSelectionCwdResolver, which returns null for Unclassified because it is not a real project, and ChatLaunchWorkflow then rejected the launch with "no working directory resolved for the launch". The generic "please try again" message was misleading — no retry could ever produce a root. Meanwhile the new-session draft resolved its cwd through AcpSessionNewCwdResolver, which owns the transport-aware fallback (stdio defaults to the user profile directory, remote transports require an explicitly selected directory). So the draft succeeded via that fallback while the launch failed on the same selection: two owners for one value. Route the launch through AcpSessionNewCwdResolver as well, reusing ResolvePreviewCwd as the request source the draft already uses, and surface the resolver's own reason instead of the generic retry message when a launch has no resolvable root. Delete SessionCwdResolver, whose only remaining call site passed a constant null second argument, leaving it a Trim wrapper. Verified: Presentation.Core suite 3276 passed, 0 failed, 0 warnings. Reverse verified by reintroducing the null-cwd path (two new tests fail) and by reverting StartViewModel against the new architecture gate (gate fails). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…on rule Documentation-only change; no tests run (docs-only per AGENTS section 5.4). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Inserting the gate left the following [Fact] indented by 8 spaces and added a stray blank line, which failed the Code Quality formatting gate. Verified with the gate's own command (dotnet format --verify-no-changes over the six touched files) and by rerunning NavigationCoreTests + StartViewModelTests: 153 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
38be781 to
e61a1fe
Compare
|
Retargeted from Why: Rebase is clean and content-preserving:
Re-verified on the
CI is re-running against the new base. |
Problem
Starting a session with the Unclassified project always failed. Production telemetry (
prod / salmonegg, 7 days, 4 events from 1 install on 1.4.2.0 Windows):Two owners resolved one value, and they disagreed:
ProjectSelectionCwdResolver, which returnsnullfor__unclassified__because it is not a real project.ChatLaunchWorkflowthen rejected the launch.AcpSessionNewCwdResolver, which owns the transport-aware fallback: stdio defaults to the user profile directory, remote transports require an explicitly selected directory.So the draft succeeded via that fallback while the launch failed on the same selection. The project selector also treats Unclassified as a legal choice, so the submit button stayed enabled — and the failure surfaced as the generic "Failed to start the session. Please try again," which no retry could ever fix.
Change
AcpSessionNewCwdResolver, reusingResolvePreviewCwd()as the same request source the draft already uses. One resolver, one request source.NewSessionDraft_MissingRemoteCwdacross all four.resx.SessionCwdResolver: its only remaining call site passed a constantnullsecond argument, leaving it aTrimwrapper masquerading as an architecture layer.ChatLaunchWorkflow's own guard as defense in depth (the interface is public andChatLaunchRequest.Cwdis nullable) and corrected its now-stale comment.Tests
Added 4 behavior tests plus 1 fail-closed architecture gate:
StartSession_WhenUnclassifiedOnStdioProfile_LaunchesWithTransportFallbackCwdStartSession_WhenLocalProjectSelected_LaunchesWithConfiguredProjectRootStartSession_WhenRemoteProfileHasNoSelectedDirectory_ReportsMissingCwdWithoutInvokingWorkflowStartSession_WhenRemoteDirectoryPathIsRelative_ReportsResolverReasonWithoutInvokingWorkflowNavigationCoreTests.StartLaunch_ResolvesCwdThroughTheTransportAwareResolverOnlyStartSessionAndSendAsync_LocalProfile_DoesNotLeakPersistedRemoteDirectoryCwdassertedAssert.Null(cwd)— it had encoded the defect as the contract. Its real intent (a local launch must not leak the persisted remote path) is preserved and strengthened to assert the stdio fallback root instead.Verification
StartViewModelalone turns the gate red.await workflowStarted.Task— the suite timed out with no failure output at all while the new tests alone passed in 0.6s. Fixed via a sharedSelectStdioProfilehelper; that failure mode is now written into AGENTS.md.Merge
Branch is based exactly on
origin/develop(0 behind, 2 ahead), so rebase merge applies cleanly with no conflicts.🤖 Generated with Claude Code