client: add 30s timeout to coding CLI creation Promise#46
Conversation
- Wrap existing Promise with Promise.race() and a timeout Promise - On timeout: reject with descriptive error, clean up pending state, set tab to 'error' - clearTimeout() in success/error paths prevents stale side effects - Add unit test verifying timeout behavior with fake timers Refs FRE-22
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 928979d932
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| dispatch(resolveCodingCliRequest({ requestId })) | ||
| unsub?.() | ||
| if (createdTabId) { |
There was a problem hiding this comment.
Kill timed-out coding CLI sessions
This timeout path resolves the request and removes the message listener, but it never issues a codingcli.kill for sessions that are created after the 30s cutoff. In a delayed-create scenario (server stall or transient WS delivery delay), codingcli.created can arrive after we unsubscribe, so the existing cleanup path is skipped and the backend session keeps running while the UI is already marked failed; server/ws-handler.ts's close handling only detaches subscriptions and does not terminate tracked coding CLI sessions.
Useful? React with 👍 / 👎.
Summary
codingCliThunks.tswithPromise.race()and a timeout PromiseclearTimeout()in success/error paths prevents stale side effects after early resolutionvi.useFakeTimers()Refs FRE-22
Generated with Claude Code