fix(chat): stick-to-bottom scroll + global chat routes code work to a sandbox - #397
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, rancargo test, committed, and pushed, instead of creating a sandbox project. Root cause: that rule lived only in thecorral-apiSKILL.md, which loads via--plugin-dirbut 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 toPOST /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