Skip to content

Working label: shows from a bench's first message, with the Corbits mark - #1115

Merged
TheGreatAxios merged 4 commits into
corbitsdev:mainfrom
pratikbuilds:chat-loader-and-scroll
Oct 9, 2026
Merged

TheGreatAxios merged 4 commits into
corbitsdev:mainfrom
pratikbuilds:chat-loader-and-scroll

Conversation

@pratikbuilds

@pratikbuilds pratikbuilds commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A new bench showed no working label while its first message waited on the worker. The opening message is sent by PendingOpeningMessage, which never marked a turn pending. It now does, and the label also gets react-ui's animated Corbits mark (Silk) beside the shimmer text.

 <PendingOpeningMessage>
   send = useMutation(sendToWorkbench)
+    onMutate: markTurnPending(bench)
+    onError: clear pendingTurn
   <own bubble> "Sending once the agent is ready…"
+  {waiting on the worker to start ? <WorkingLabel /> : null}

 <WorkingLabel> (apps/web/src/chat/working-label.tsx)
+  <ThinkingMark variant="silk" />
   <ThinkingLabel verbs={["Thinking…", "Working on it…"]} />

While the worker is starting, the label shows under the pending message. Once the worker is live, the send marks the turn pending and the page's own WorkingLabel takes over until the reply lands, so the two never show together.

Browser suites that start a bench from /new now share one startWorkbench(page, message) helper in e2e/lib/first-run.ts. It waits for the composer and send button to be enabled first (CL-9780). reply, zero-to-one, and first-run typed into a still-disabled composer and stalled on /new; composer-layout, ollama-chat, and setup had the same race.

Evidence

  • Before: e2e/browser/reply.test.ts fails at the new check. After creating a bench from /new, .chat-thread-working never appears: the thread shows "Say hello" and no label.
    After: passes. The label appears as the bench opens and clears when the worker's reply lands.
reply: create bench from /new with the aimock provider
  on /w/<bench>     → .chat-thread-working is shown
  reply lands       → no "working" left on the page

Checked in a live bench: the label with the mark appeared within a second of the bench opening, stayed through "Sending once the agent is ready…" and the send, and cleared when the worker's greeting arrived about 8s later. Follow-up messages show it as before.

Merge Danger

Door: two-way

UI and e2e only; no schema, API, or data changes. Reverting restores the old behavior.

Blast Radius: bench thread

The working label row now includes the mark. Related but not changed here: #1116 (the first message can be sent to the wrong bench when switching benches early).

The /new composer and its send button stay disabled until workspace
roles have loaded (CL-9780). Suites that typed straight away lost the
input and stalled on /new waiting for a bench that was never created.
One shared startWorkbench(page, message) helper in e2e/lib/first-run.ts
now waits for both before typing and clicking, and every suite that
starts a bench uses it.
After creating a bench from /new, the thread shows the working label
while the opening message waits on the worker to start and reply.
… mark

The opening message is sent by PendingOpeningMessage, which never marked
a turn pending, so a new bench showed nothing while its worker started
and replied. The send now marks the turn pending (and clears it on
error), and the label shows under the pending message while the worker
is still starting; once live, the page's own label takes over until the
reply lands.

The label now pairs react-ui's ThinkingMark (Silk) with the existing
shimmering ThinkingLabel.
@pratikbuilds
pratikbuilds force-pushed the chat-loader-and-scroll branch 2 times, most recently from 9398915 to b6e487b Compare October 8, 2026 07:54
@pratikbuilds pratikbuilds changed the title Bench thread: working label from the first message, and the thread stays on its newest message Working label: shows from a bench's first message, with the Corbits mark Oct 8, 2026
@pratikbuilds

Copy link
Copy Markdown
Collaborator Author

Here is a preview of it.

Screen.Recording.2026-10-08.at.6.09.24.PM.mov

@pratikbuilds
pratikbuilds marked this pull request as ready for review October 8, 2026 12:26

@TheGreatAxios TheGreatAxios 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.

Much improved...I think in the next couple of iterations I want to change the order of operations, cleanup the thinking during active chat, fix width, etc; but this solves the issue at hand nicely

@TheGreatAxios TheGreatAxios added the enhancement New feature or request label Oct 8, 2026
@pratikbuilds

Copy link
Copy Markdown
Collaborator Author

Resolved the conflicts with main in this merge update.

  • Kept main's test consolidation: setup.test.ts and composer-layout.test.ts were folded into first-run.test.ts, and reply.test.ts was folded into zero-to-one.test.ts. These files were already removed on main; this resolution introduces no additional file deletions relative to main.
  • Moved the first-message loading-label assertions into zero-to-one.test.ts: the label must appear after starting the bench and disappear after the worker replies.
  • Kept startWorkbench() and applied it to the relocated setup/composer tests, preserving the wait for the composer and send button to be enabled.
  • Preserved the PR's loading-label and Corbits mark implementation.

Validation: typecheck, lint, formatting, and all four affected browser tests passed. The browser tests cover the first reply, follow-up, artifact creation, worker naming/rename, setup, tenant isolation, and composer layout.

bun run check still exits unsuccessfully because the unchanged @corbits/url-path and @corbits/workflows package scripts run bun test with no test files. Root DB-gated e2e was skipped without DATABASE_URL; the four browser tests were run separately against a dedicated local test database, which was removed afterward. The empty-suite failures were disclosed before approval to commit.

@TheGreatAxios
TheGreatAxios merged commit 285e10e into corbitsdev:main Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants