Skip to content

fix(chat): stick-to-bottom scroll + global chat routes code work to a sandbox - #397

Merged
jrothrock merged 2 commits into
mainfrom
fix/chat-scroll-and-conductor-routing
Sep 4, 2026
Merged

fix(chat): stick-to-bottom scroll + global chat routes code work to a sandbox#397
jrothrock merged 2 commits into
mainfrom
fix/chat-scroll-and-conductor-routing

Conversation

@jrothrock

Copy link
Copy Markdown
Collaborator

Two chat fixes.

1. Don't yank the view down while reading during a stream

The chat force-scrolled to the bottom on every streamed frame, so scrolling up to read earlier output mid-turn kept snapping you back down.

Now stick-to-bottom: scroll() only auto-scrolls when you're at/near the bottom. A user scroll-up clears the intent; our own programmatic autoscroll is guarded so it doesn't re-arm it. Sending your own message re-sticks (you follow it). Measured against the live DOM each frame.

Verified (Playwright): scrolling up mid-stream stays put as content keeps growing; at-bottom still sticks; sending re-sticks.

2. Global chat routes code work to a sandbox (not inline on the host)

Despite the earlier guidance (#394), the global chat still did repo code work inline — from the logs, it cd'd into ~/core-agent, ran cargo test, committed, and pushed, instead of creating a sandbox project. Root cause: that rule lived only in the corral-api SKILL.md, which loads via --plugin-dir but is only read when the model invokes the skill — for a "run the tests on repo X" ask it often never does.

Fix: move the rule into the always-on first-turn context (chatConductorGuidance), global chat only (workspace=="" — a project chat already runs inside a sandbox). The model now sees "you're a conductor on the host; route code work to POST /projects/create" from turn one, regardless of whether it loads the skill. The skill keeps the full API detail.

Go tests + typecheck + build pass.

🤖 Generated with Claude Code

jrothrock and others added 2 commits September 4, 2026 17:01
The chat force-scrolled to the bottom on every streamed frame, so reading
earlier output mid-turn kept snapping you back down.

Stick-to-bottom now: scroll() only auto-scrolls when the user is at/near the
bottom. A user scroll-up clears the intent (onScroll → stickRef=false); our
own programmatic autoscroll is guarded so it doesn't re-arm the intent.
Sending your own message re-sticks (you follow it). Measured against the live
DOM each frame so a growing transcript can't strand a stale value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…text

The global chat still did repo code work inline on the host — e.g. it `cd`'d
into ~/core-agent, ran cargo test, committed, and pushed, instead of creating
a sandbox project. Root cause (from the logs): the "code tasks run in a
sandbox" rule lives in the corral-api SKILL.md, which loads via --plugin-dir
but is only READ when the model invokes the skill — for a "run the tests on
repo X" ask it often never does.

Move the rule into the always-on first-turn context (chatConductorGuidance in
withContextHint), GLOBAL chat only (workspace=="" — a project chat already runs
inside a sandbox). Now the model sees "you're a conductor on the host; route
code work to POST /projects/create" from turn one, regardless of whether it
loads the skill. The skill keeps the full API detail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jrothrock
jrothrock merged commit 60ed998 into main Sep 4, 2026
1 check passed
@jrothrock
jrothrock deleted the fix/chat-scroll-and-conductor-routing branch September 4, 2026 23:01
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.

1 participant