🤖 refactor: dedupe SSH/Coder startup barrier replay logic#3134
Open
ammar-agent wants to merge 1 commit intomainfrom
Open
🤖 refactor: dedupe SSH/Coder startup barrier replay logic#3134ammar-agent wants to merge 1 commit intomainfrom
ammar-agent wants to merge 1 commit intomainfrom
Conversation
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
--- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$44.22`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=44.22 -->
4a743ee to
400ff14
Compare
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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 follow-up to #3133 deduplicates the logic that keeps the SSH/Coder startup barrier consistent during reconnects and workspace switching.
Background
#3133 fixed a concrete bug: startup detail like
Checking workspace runtime...could disappear if you switched away from an SSH/Coder workspace and then switched back.The first cleanup pass in this PR already moved low-level
stream-lifecycleandruntime-statushelper logic intosrc/common/types/stream.ts. This update follows through on the next cleanup opportunities nearby:WorkspaceStoreuse one replay-buffering path for previewing replayed startup/error state beforecaught-upProjectSidebarAgentSession's replayed startup/terminal status emission into a named helperImplementation
stream-lifecycle/runtime-statushelper logic now lives insrc/common/types/stream.tsAgentSessionnow replays terminal/preparing status throughemitReplayStatusSnapshot(...)instead of open-coding that state machine insideemitHistoricalEvents()WorkspaceStorenow routes pre-caught-upbuffering throughgetBufferedReplayEventBehavior(...), so replayedstream-error,stream-lifecycle,stream-abort, andruntime-statusfollow one preview/buffer pathProjectSidebarnow uses replay-aware sidebar state for:instead of recomputing startup state from raw aggregator fields
ProjectSidebartests now providegetWorkspaceSidebarState()in the mocked workspace store so the shared sidebar-state path is exercised directlysrc/common/types/stream.test.tsValidation
bun test src/browser/stores/WorkspaceStore.test.ts src/node/services/agentSession.preStreamError.test.ts src/browser/components/ProjectSidebar/ProjectSidebar.test.tsxbun test src/common/types/stream.test.ts src/browser/utils/messages/StreamingMessageAggregator.runtimeStatus.test.ts src/node/services/agentSession.preStreamError.test.ts src/browser/stores/WorkspaceStore.test.tsmake typecheckmake static-checkgit diff --checkRisks
Low. This is intended to stay behavior-preserving, but it touches the reconnect/workspace-switch startup path in both the backend replay layer and the renderer. The main regression risk would be stale or missing startup barrier state while replay is hydrating.
Generated with
mux• Model:openai:gpt-5.4• Thinking:xhigh• Cost:$44.22