Skip to content

[codex] Remove chat-triggered Slack connect flow - #5463

Merged
serrrfirat merged 4 commits into
mainfrom
codex/remove-chat-slack-connect-flow
Jun 30, 2026
Merged

serrrfirat merged 4 commits into
mainfrom
codex/remove-chat-slack-connect-flow

Conversation

@serrrfirat

Copy link
Copy Markdown
Collaborator

Summary

Removes the Reborn WebUI v2 chat-triggered Slack/channel connection flow entirely. Chat no longer tries to classify user text or slash-style input as a channel connection command.

Slack setup and pairing remain available through the dedicated Extensions/channel UI. The shared channel-connect.js module now only exposes listConnectableChannels() for that UI.

Why

The chat path had brittle text matching around Slack connection activation. Even after narrowing it, chat-owned connection shortcuts still made normal messages like Slack setup or regex questions vulnerable to being treated as UI activation commands. The safer product boundary is explicit UI setup only.

Behavior

  • /connect slack submits as normal chat text.
  • connect my Slack account submits as normal chat text.
  • setup a Slack regex for chat routing submits as normal chat text.
  • Chat no longer fetches connectable channels before sending.
  • Extensions/channel UI still renders Slack setup and pairing controls.

Validation

  • node --test crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs
  • node --test crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/chat.test.mjs
  • cargo test -p ironclaw_webui_v2_static
  • git diff --check

Note: the first cargo test -p ironclaw_webui_v2_static attempt hit No space left on device while writing Rust incremental cache under target/; after clearing generated incremental cache, the same test command passed.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1a17e4f6-43b5-40ae-bd75-6e76824f56ba

📥 Commits

Reviewing files that changed from the base of the PR and between 96e5b75 and c49059a.

📒 Files selected for processing (1)
  • crates/ironclaw_reborn_composition/src/slack_host_beta/runtime_setup.rs

📝 Walkthrough

Summary by CodeRabbit

  • Changes
    • Removed the in-chat channel connect card and all connect action/dismiss handling from the chat page.
    • Slack “slash connect” (/connect ...) submissions now go directly to the model, without triggering a connectable-channel lookup.
  • Bug Fixes
    • Improved thread switching by clearing transient processing and gate/busy notices more reliably to prevent stale UI from carrying over.
  • Tests
    • Updated chat and channel-connect regression coverage to reflect the removed connect UI/command behavior.

Walkthrough

Removes the Slack channel-connect UI and command path in the web UI, updates the associated tests and fixtures, and changes Slack triggered-run delivery to run inline in the composition runtime.

Changes

Channel-connect removal

Layer / File(s) Summary
connect helper change
crates/ironclaw_webui_v2_static/static/js/lib/channel-connect.js
Replaces command-resolution exports with listConnectableChannels().
chat hook and page cleanup
crates/ironclaw_webui_v2_static/static/js/pages/chat/hooks/useChat.js, crates/ironclaw_webui_v2_static/static/js/pages/chat/chat.js, crates/ironclaw_webui_v2_static/static/js/pages/chat/components/channel-connect-card.js
Removes connect-action state and pre-send connect handling, expands thread-switch resets, and deletes the chat-page connect card wiring and component implementation.
chat fixture updates
crates/ironclaw_webui_v2_static/src/assets.rs, crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/chat.test.mjs
Updates asset assertions and chat-page fixtures to match the removed connect UI and hook fields.
send and gate test rewrites
crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs
Reworks send, gate, cancel, and parallel-thread tests for the revised hook state ordering and connect-less send flow.

Slack triggered-run delivery

Layer / File(s) Summary
inline trigger delivery
crates/ironclaw_reborn_composition/src/slack_host_beta/runtime_setup.rs
on_trigger_submitted now awaits current_driver(), forwards the trigger to the resolved driver inline, and keeps the existing debug and warning branches for missing or unavailable drivers.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

  • nearai/ironclaw#4738: Overlaps on the chat send path that distinguishes /connect ... handling from ordinary message submission.
  • nearai/ironclaw#5021: Touches the same useChat thread-switch and connect-state cleanup area.
  • nearai/ironclaw#5166: Modifies the same Slack triggered-run delivery hook path in runtime_setup.rs.

Suggested reviewers

  • think-in-universe

A connect card waved and slipped away,
Slash commands quieted for the day.
One hook now waits, no spawn in sight,
State and tests are trimmed just right.
🧹

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly matches the main change: removing the chat-triggered Slack connect flow; it just isn't Conventional Commits formatted.
Description check ✅ Passed The key sections are present (Summary, Why, Behavior, Validation), so the template is mostly satisfied despite several optional sections being omitted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5463 June 30, 2026 20:22 Destroyed
@github-actions github-actions Bot added size: XL 500+ changed lines risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Jun 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes the channel connect slash command functionality, including the ChannelConnectCard component, the channelConnectAction state, and its resolution logic from the chat page and the useChat hook. The associated tests have been updated to reflect these removals and the resulting shift in state indices. The review feedback highlights a bug in the test suite where an assertion still queries index === 6 instead of the shifted index === 5 for busyGateNotice, resulting in a silent loss of test coverage, and suggests updating an outdated comment describing the state slot order.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

assert.equal(stateSlots.get(4).value, pendingGate);
assert.equal(renderedMessages.length, 0);
assert.deepEqual(
stateUpdates.filter((call) => call.index === 6).map((call) => call.value?.content),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Since the channelConnectAction state variable (previously index 3) has been removed, the indices of all subsequent state variables in useChat have shifted down by 1. Specifically, busyGateNotice is now index 5 (previously index 6). Filtering stateUpdates by index === 6 actually targets stateThreadId (now index 6) instead of busyGateNotice, which causes the assertion to check the wrong state variable and silently lose test coverage. This should be updated to index === 5.

Suggested change
stateUpdates.filter((call) => call.index === 6).map((call) => call.value?.content),
stateUpdates.filter((call) => call.index === 5).map((call) => call.value?.content),

Comment on lines 2544 to 2546
// State slot order: cooldownUntil(0), now(1), activeRun(2),
// channelConnectAction(3), isProcessing(4), pendingGate(5),
// isProcessing(3), pendingGate(4),
// busyGateNotice(6), stateThreadId(7).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The comment describing the state slot order is outdated. Since channelConnectAction was removed, busyGateNotice is now index 5 and stateThreadId is index 6. Let's update the comment to reflect the correct indices.

Suggested change
// State slot order: cooldownUntil(0), now(1), activeRun(2),
// channelConnectAction(3), isProcessing(4), pendingGate(5),
// isProcessing(3), pendingGate(4),
// busyGateNotice(6), stateThreadId(7).
// State slot order: cooldownUntil(0), now(1), activeRun(2),
// isProcessing(3), pendingGate(4),
// busyGateNotice(5), stateThreadId(6).

@serrrfirat
serrrfirat marked this pull request as ready for review June 30, 2026 20:26
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5463 June 30, 2026 20:29 Destroyed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs (4)

1093-1096: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Likely wrong index for the busy-notice "no content" check.

busyGateNotice objects carry a .content field (see line 807); per the file's mapping that's index 5, not 6 (index 6 is stateThreadId, a plain string with no .content). This filter is effectively a no-op and doesn't exercise the intended guarantee.

🐛 Proposed fix
   assert.deepEqual(
-    stateUpdates.filter((call) => call.index === 6).map((call) => call.value?.content),
+    stateUpdates.filter((call) => call.index === 5).map((call) => call.value?.content),
     [],
   );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`
around lines 1093 - 1096, The busy-notice “no content” assertion is checking the
wrong state update index in useChat-send.test.mjs, so it never validates
busyGateNotice.content. Update the filter in the relevant test to target the
state update slot that actually holds the busyGateNotice object (the one mapped
to content in this test file, not stateThreadId), and keep the assertion that
its content collection is empty so the intended guarantee is exercised.

2267-2334: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Test name promises "does not fetch" but the mock allows the fetch to succeed.

Unlike every other "should not fetch connectable channels" test in this file (e.g. lines 109-111, 337-339, 1776-1779), this one's queryClient.fetchQuery is permissive (async ({ queryFn }) => queryFn()) instead of throwing. If a future regression reintroduces a pre-send fetchQuery call, this test would still pass — it provides no actual signal for the behavior it's named after.

🐛 Proposed fix
     queryClient: {
-      fetchQuery: async ({ queryFn }) => queryFn(),
+      fetchQuery: async () => {
+        throw new Error("chat send should not fetch connectable channels");
+      },
       invalidateQueries: () => {},
     },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`
around lines 2267 - 2334, The test useChat.send: does not fetch connectable
channels before submitting chat is too permissive because queryClient.fetchQuery
currently executes the queryFn instead of failing, so it would not catch a
regression. Update the test setup in useChat-send.test.mjs so fetchQuery throws
if called, matching the other “should not fetch connectable channels” tests, and
keep the assertions around createThreadRequest, sendMessage, and loggedErrors to
verify send() never triggers a pre-send channel fetch.

811-914: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Wrong state-slot index: busy-notice check reads stateThreadId, not busyGateNotice.

index === 6 is stateThreadId per the established mapping in this same file (see the "thread switch render" test, lines 1262-1328, and createResolveGateContext's comment at 2345-2346: pendingGate=4, busyGateNotice=5, stateThreadId=6). The sibling test just above (lines 798-808) correctly checks index === 5 for the busy notice. As written, this assertion can't detect a busy notice incorrectly written into the deactivated thread.

🐛 Proposed fix
   assert.deepEqual(
-    stateUpdates.filter((call) => call.index === 6).map((call) => call.value),
+    stateUpdates.filter((call) => call.index === 5).map((call) => call.value),
     [],
     "a busy gate notice must not be written into a thread that became active later",
   );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`
around lines 811 - 914, The assertion in the busy-seeds test is checking the
wrong state slot index, so it cannot detect a misplaced busy notice. Update the
check in the `useChat.send: rejected busy seeds notice when active thread
changed in flight` test to target the `busyGateNotice` slot used elsewhere in
this file, matching the established mapping from `createResolveGateContext` and
the sibling busy-notice test. Keep the rest of the test logic the same, but make
sure the `stateUpdates` filter verifies the busy notice slot rather than
`stateThreadId`.

916-1002: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Two wrong state-slot indices in this test.

stateSlots.get(5) should be stateSlots.get(4) (pendingGate — see lines 708-712/803 where setPendingGateFromEvents consistently writes index 4), and the index === 6 filter at the end should be index === 5 (busyGateNotice, per the file-wide mapping). As written, neither assertion checks the slot its message claims to verify.

🐛 Proposed fix
-  assert.equal(stateSlots.get(5).value, null);
+  assert.equal(stateSlots.get(4).value, null);
   assert.equal(renderedMessages.length, 2);
   assert.equal(renderedMessages[0].status, "error");
   assert.equal(renderedMessages[1].role, "system");
   assert.equal(renderedMessages[1].content, "Thread is busy, please try again.");
   assert.deepEqual(
-    stateUpdates.filter((call) => call.index === 6).map((call) => call.value),
+    stateUpdates.filter((call) => call.index === 5).map((call) => call.value),
     [],
     "a resolved gate should not get a lingering card-level busy notice",
   );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`
around lines 916 - 1002, The test in useChat.send is asserting the wrong state
slots for pendingGate and busyGateNotice. Update the assertion that reads
stateSlots.get(5) to use the pendingGate slot consistent with
setPendingGateFromEvents and the existing slot mapping, and change the
stateUpdates filter from index === 6 to the busyGateNotice slot used throughout
this file. Keep the test names and expectations aligned with the actual slot
indices referenced by useChat and useChatEvents.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`:
- Around line 2543-2546: The state slot order comment in the fixture is stale
and mislabels busyGateNotice and stateThreadId by one index. Update the mapping
in the test setup around initialByIndex to match the established slot order used
elsewhere in useChat-send.test.mjs, keeping busyGateNotice and stateThreadId
aligned with their actual indices so the comment remains accurate if this
fixture is extended.

---

Outside diff comments:
In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`:
- Around line 1093-1096: The busy-notice “no content” assertion is checking the
wrong state update index in useChat-send.test.mjs, so it never validates
busyGateNotice.content. Update the filter in the relevant test to target the
state update slot that actually holds the busyGateNotice object (the one mapped
to content in this test file, not stateThreadId), and keep the assertion that
its content collection is empty so the intended guarantee is exercised.
- Around line 2267-2334: The test useChat.send: does not fetch connectable
channels before submitting chat is too permissive because queryClient.fetchQuery
currently executes the queryFn instead of failing, so it would not catch a
regression. Update the test setup in useChat-send.test.mjs so fetchQuery throws
if called, matching the other “should not fetch connectable channels” tests, and
keep the assertions around createThreadRequest, sendMessage, and loggedErrors to
verify send() never triggers a pre-send channel fetch.
- Around line 811-914: The assertion in the busy-seeds test is checking the
wrong state slot index, so it cannot detect a misplaced busy notice. Update the
check in the `useChat.send: rejected busy seeds notice when active thread
changed in flight` test to target the `busyGateNotice` slot used elsewhere in
this file, matching the established mapping from `createResolveGateContext` and
the sibling busy-notice test. Keep the rest of the test logic the same, but make
sure the `stateUpdates` filter verifies the busy notice slot rather than
`stateThreadId`.
- Around line 916-1002: The test in useChat.send is asserting the wrong state
slots for pendingGate and busyGateNotice. Update the assertion that reads
stateSlots.get(5) to use the pendingGate slot consistent with
setPendingGateFromEvents and the existing slot mapping, and change the
stateUpdates filter from index === 6 to the busyGateNotice slot used throughout
this file. Keep the test names and expectations aligned with the actual slot
indices referenced by useChat and useChatEvents.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e84e7b2e-6e7b-4763-8adf-55408365a54b

📥 Commits

Reviewing files that changed from the base of the PR and between 73ea1ff and a39f7c3.

📒 Files selected for processing (9)
  • crates/ironclaw_webui_v2_static/src/assets.rs
  • crates/ironclaw_webui_v2_static/static/js/lib/channel-connect.js
  • crates/ironclaw_webui_v2_static/static/js/lib/channel-connect.test.mjs
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/chat.js
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/components/channel-connect-card.js
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/components/channel-connect-card.test.mjs
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/hooks/useChat.js
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/chat.test.mjs
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs
💤 Files with no reviewable changes (6)
  • crates/ironclaw_webui_v2_static/static/js/lib/channel-connect.test.mjs
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/components/channel-connect-card.test.mjs
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/components/channel-connect-card.js
  • crates/ironclaw_webui_v2_static/static/js/lib/channel-connect.js
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/hooks/useChat.js
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/chat.test.mjs

Comment thread crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs (1)

2219-2287: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Test name claims no connectable-channels fetch but the stub doesn't enforce it.

This test asserts behavior "without fetching connectable channels," yet queryClient.fetchQuery (line 2245) just executes queryFn() instead of throwing like every sibling test does (e.g. lines 2004-2007, 2158-2161). If a regression reintroduced a pre-send connectable-channels fetch, this test would still pass.

🧪 Proposed fix to actually enforce the claim
     queryClient: {
-      fetchQuery: async ({ queryFn }) => queryFn(),
+      fetchQuery: async () => {
+        throw new Error("slash-connect prompts should not fetch connectable channels");
+      },
       invalidateQueries: () => {},
     },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`
around lines 2219 - 2287, The test “useChat.send: slash connect text submits to
the model without fetching connectable channels” does not actually enforce that
no connectable-channels lookup happens. Update the `queryClient.fetchQuery` stub
in this test to match the sibling tests by throwing if it is called, so any
unexpected pre-send fetch fails the test. Keep the existing assertions on
`useChat`, `send`, and `createThreadRequest` behavior, but make the no-fetch
expectation explicit through the stub.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs`:
- Around line 2219-2287: The test “useChat.send: slash connect text submits to
the model without fetching connectable channels” does not actually enforce that
no connectable-channels lookup happens. Update the `queryClient.fetchQuery` stub
in this test to match the sibling tests by throwing if it is called, so any
unexpected pre-send fetch fails the test. Keep the existing assertions on
`useChat`, `send`, and `createThreadRequest` behavior, but make the no-fetch
expectation explicit through the stub.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 27d4c93a-7cea-420b-9a3e-58dea6680b94

📥 Commits

Reviewing files that changed from the base of the PR and between e59f61f and 3c9dfe4.

📒 Files selected for processing (2)
  • crates/ironclaw_webui_v2_static/src/assets.rs
  • crates/ironclaw_webui_v2_static/static/js/pages/chat/lib/useChat-send.test.mjs

@serrrfirat
serrrfirat force-pushed the codex/remove-chat-slack-connect-flow branch from 3c9dfe4 to 96e5b75 Compare June 30, 2026 20:51
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5463 June 30, 2026 20:52 Destroyed
@railway-app

railway-app Bot commented Jun 30, 2026

Copy link
Copy Markdown

🚅 Deployed to the ironclaw-pr-5463 environment in ironclaw-ci-preview

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Jun 30, 2026 at 9:00 pm

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5463 June 30, 2026 21:35 Destroyed
@serrrfirat
serrrfirat merged commit 3bc010b into main Jun 30, 2026
105 checks passed
@serrrfirat
serrrfirat deleted the codex/remove-chat-slack-connect-flow branch June 30, 2026 21:55

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-5463 — c49059a0 Deployed Jun 30, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: low Changes to docs, tests, or low-risk modules size: XL 500+ changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant