Skip to content

client: add 30s timeout to coding CLI creation Promise#46

Merged
danshapiro merged 1 commit intodanshapiro:mainfrom
bradfeld:feature/FRE-22-no-timeout-promise-coding-cli
Feb 15, 2026
Merged

client: add 30s timeout to coding CLI creation Promise#46
danshapiro merged 1 commit intodanshapiro:mainfrom
bradfeld:feature/FRE-22-no-timeout-promise-coding-cli

Conversation

@bradfeld
Copy link
Copy Markdown
Contributor

Summary

  • Wrap existing Promise in codingCliThunks.ts with Promise.race() and a timeout Promise
  • On timeout (30s): reject with descriptive error, clean up pending Redux state, set tab status to 'error'
  • clearTimeout() in success/error paths prevents stale side effects after early resolution
  • Add unit test verifying timeout behavior with vi.useFakeTimers()

Refs FRE-22

Generated with Claude Code

- 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
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +112 to +114
dispatch(resolveCodingCliRequest({ requestId }))
unsub?.()
if (createdTabId) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@danshapiro danshapiro merged commit db70432 into danshapiro:main Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants