Skip to content

🤖 fix: Run /init is off whenever the creation composer cannot send - #6458

Merged
ThomasK33 merged 2 commits into
mainfrom
fix/6423-run-init-follows-send-gate
Oct 14, 2026
Merged

ThomasK33 merged 2 commits into
mainfrom
fix/6423-run-init-follows-send-gate

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

The creation view's "Run /init" button is now off whenever the creation composer cannot send, not only while the branch list loads. While Coder presets load, a send is in flight, attachments are processing or the composer is disabled, a click used to be refused by the composer and left /init unsent.

Fixes #6423

Background

"Run /init" restores /init in the creation composer and calls its send() once. #6417 (fix for #6038) turned the button off while the branch list loads or has failed, but canSend has more blockers. The final check of #6417 found the gap and #6423 tracked it.

Implementation

useReportCreationSendBlocked now takes the same blockers that canSend checks: disabled, a send in flight, processing attachments, Coder presets loading, and the branch list. It leaves out an empty draft, because the banner brings its own text. The page side (useCreationSendBlocked in ProjectPage, scoped per composer) is unchanged. The blockers are combined inside the hook, so ChatInputInner gains no complexity (CRAP gate).

Validation

Two new tests in tests/ui/agents/creationWaitsForBranches.test.ts (real backend) failed on main with Expected: true, Received: false (the button was enabled) and pass now:

  • "Run /init is off while the Coder presets load": CoderService reports an available CLI and one template, and listPresets is held. After the user picks the Coder runtime, the button turns off, and it turns on again when the presets load.
  • "Run /init is off while a send is in flight": WorkspaceService.create is held after a Send click. The button stays off while the send is in flight.

The file passes 9 of 9 (the #6033, #6055 and #6038 tests still pass). The ChatInput and ProjectPage unit tests give 186 pass, 0 fail.

Dogfood (production build, mock AI, git worktree held so the creation send stays in flight). Run /init during the send: main enabled, this PR disabled (1280 and 390 px).

Before, send in flight (main, 1280 px):
Before: Run /init enabled while a creation send is in flight

After, send in flight (1280 px):
After: Run /init disabled while a creation send is in flight

After, send in flight (390 px):
After at 390 px: Run /init disabled while a creation send is in flight

First-load JS (make first-load-js, base 9aec386 vs this head): total raw 2,266.8 KiB on both, brotli 455.3 KiB to 455.5 KiB, gzip 558.2 KiB to 558.3 KiB.

Risks

Low. Only the creation page banner reads the report. A workspace composer reports nothing.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $324.26

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T07:43:29.743793Z d037b9f New commits
🔒 Security Review ✅ Completed 2026-10-14T07:43:26.338950Z d037b9f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

Perf gate: CLEARED at f14bf326fdc68c7be416709688e347e1c56be9a5 (perf owner, workspace 8e18f4aada).

I checked these facts myself:

  1. The head matches git ls-remote. The merge-base is 9aec386e7f. The numstat is 11/1 in index.tsx, 27/6 in useReportCreationSendBlocked.ts, and 92/0 in one UI test.
  2. Each ChatInputInner render, including each keystroke, builds one 5-field object of booleans that the component already computed, plus one Object.values(...).some(Boolean). That costs nanoseconds.
  3. The effect dependencies are still [blocked, report], so the effect runs only when the boolean changes. In the workspace variant, report is undefined.
  4. Stream events do no new work. The PR adds no subscription, listener or manual memo.
  5. First-load JS is +0.2 KiB brotli in total. The lane measured this, and I did not rebuild to check it.

This clearance covers only this head. A new head needs a new clearance.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

The "Run /init" banner sends through the creation composer once. It was
gated only on the branch list (#6038), so while Coder presets loaded, a
send was in flight, attachments were processing or the composer was
disabled, a click was refused and left /init unsent. The composer now
reports the same blockers that canSend checks (apart from an empty
draft, since the banner brings its own text).

Fixes #6423

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33
ThomasK33 force-pushed the fix/6423-run-init-follows-send-gate branch from f14bf32 to d037b9f Compare October 14, 2026 07:41
@ThomasK33

Copy link
Copy Markdown
Member Author

Perf gate: re-CLEARED at d037b9fc3910c1129e94ed5061837e674d7ecf6e (perf owner, workspace 8e18f4aada). This replaces my clearance of f14bf326fd.

I checked these facts myself:

  1. The head matches git ls-remote. The merge-base is b20d868fcf.
  2. git range-diff shows the cleared commit unchanged after the rebase (=), plus one new commit.
  3. The new commit changes only a comment in ProjectPage.tsx (3/2 lines).

A new head needs a new clearance.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 93a891b Oct 14, 2026
32 of 33 checks passed
@ThomasK33
ThomasK33 deleted the fix/6423-run-init-follows-send-gate branch October 14, 2026 08:51
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.

🤖 fix: "Run /init" stays enabled when Send is off for reasons other than the branch list

1 participant