Repository navigation
Native chat: inline visuals for Grok, OpenCode and OMP chats - #26530
Conversation
Each ACP agent loads the chat-visuals skill its own way for one launch, without touching the user's agent config: Grok through agent --plugin-dir, OpenCode 2.x through inline skills.paths, OMP through a PI_CONFIG_FILES overlay that keeps the user's own skill folders. A chat whose agent can't load it starts without visuals.
OMP's settings layers replace lists, so the PI_CONFIG_FILES overlay hid a repo's or profile's own skill folders in Orca's OMP chats, and its files were never removed. omp acp takes --plugin-dir like Grok, which adds the skill beside the user's own plugins and skill folders and leaves their config untouched.
Review summaryThe problem. Inline visuals (charts, diagrams and mockups drawn inside an agent's reply) worked only in Claude and Codex chats. Grok, OpenCode and OMP chats in Chat UI were never given the visuals instructions or a folder to write into, so they always answered in plain text. What changes for users. New and resumed Grok, OpenCode (2.x) and OMP chats in Chat UI can now draw inline visuals, the same as Claude and Codex chats. The existing Inline visuals switch in Chat settings turns it off for them too. Terminal-based chats are unchanged; they're out of scope here. Fixed during review
Deferred
Found while testing, not caused by this PR
Verified
Not verified
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughACP launch specs now support agent-specific visuals-skill loaders and plugin-directory arguments. Launch resolution prepares visuals, probes versions when needed, loads skills, and applies the resulting environment settings. Runtime registration passes native chat visuals configuration to ACP launch resolution. Tests cover loader behavior, launch arguments, environment handling, and failure cases. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No identified issue blocks merging. If visuals preparation fails, the chat can still launch without visuals. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
ELI5
Native chat can show charts, diagrams and mockups inside an agent's reply, but only Claude and Codex chats knew how. Grok, OpenCode and OMP chats never learned the feature existed, so they never drew one. This teaches those three agents too.
What Changed
Before: an inline visual could only appear in a Claude or Codex chat. A Grok, OpenCode or OMP chat had no visuals folder and no instructions, so it answered in plain text even when a chart would help.
After: a new Grok, OpenCode (2.x) or OMP chat gets the same visuals instructions (the
orca-chat-visualsskill) and its own visuals folder, and the chat view already draws what it writes. The existing Inline visuals switch in Chat settings turns it off for these agents too.Mechanism. The protocol these agents speak (ACP) has no way to hand an agent a skill, so each agent's launch description now says how that agent loads one for a single launch, without touching the user's own agent settings:
grok agent --plugin-dir <Orca's skill plugin> stdio, the per-process flag Grok documents for this. Grok has no supported-version list in Orca, so when visuals are on, the launch asks for its--versionfirst. Releases before 1.0.44 (the oldest I could check) start without visuals instead of failing on an unknown flag.skills.pathsin the inline config variable, keeping any inline config the user already set. 2.x adds that list to the one in the user's config files.omp acp --plugin-dir <Orca's skill plugin>, the same per-process flag and plugin layout as Grok. OMP adds the plugin beside the user's own installed plugins and skill folders and writes nothing to disk for it, so the user's global, profile, project and extra config files apply exactly as they set them. No extra version check: every OMP release Orca runs chats on (17.0.5 and later) has the flag.ORCA_CHAT_VISUALS_DIRis stripped so the agent never writes into another chat's folder.Code:
src/main/acp/acp-visuals-skill.ts(per-agent loaders),src/main/acp/acp-structured-launch-visuals.tsandacp-structured-launch-resolution.ts(launch wiring),src/main/acp/acp-launch-specs.ts(each agent's loader).Why
ACP has no channel for skills, so loading has to happen through each agent's own startup options. The alternative, installing the skill into the user's real agent folders (
~/.grok/skillsand the like), would change their setup for agents outside Orca too. Per-launch options leave their setup untouched.Differences from Claude and Codex chats:
skills.paths(checked on 1.18.31), so their own skills would vanish from Orca chats./skill:orca-chat-visualscommand (intended for now). OMP ignores the field Claude uses to hide it.--plugin-dirby default; 18.1.9 fixed it. They were current for about a day and a half, so there's no version-range check, only a code comment.--plugin-dirthere. A per-session way to hand Grok a plugin exists, but using it needs new plumbing in the session start/resume requests; follow-up.Linked Issue
N/A (internal follow-up to #26099 / #26358).
Visual Proof
Hidden Orca window at this branch's head, chats answered by a local stand-in model (no sign-in needed) so each step is repeatable. The stand-in draws a chart only if the agent was actually given the
orca-chat-visualsskill, and writes it with the agent's own shell command.OpenCode, Inline visuals on: the chart renders inline in the reply.
OpenCode, Inline visuals off: the agent isn't given the skill, so it answers in plain text.
OMP, default permissions: writing the page asks for approval like any other shell command (the card shows the command, not an Orca folder path); after "Allow once" the chart renders.
Grok: no signed-in account was used. The chat's Grok process was started as
grok agent --always-approve --plugin-dir <Orca>/resources/native-chat-visuals stdio.Testing
New unit tests:
src/main/acp/acp-visuals-skill.test.ts,src/main/acp/acp-structured-launch-visuals.test.ts; updated Grok args and OMP environment tests.src/main/acp, structured-agent runtime and visuals tests: 434 passing under Node.pnpm tc:nodepasses;orca-ci-checkspasses 22/22.Against the real CLIs, each in an isolated scratch home with no credentials:
session/load), and the visuals folder reaches OMP's shell. Skill folders the user set in a project.omp/config.yml, an OMP profile, or their own extra config files are all still listed beside it. OMP writes nothing extra to its home.orca-chat-visuals, and the user's ownskills.pathsskills still show.--plugin-dirand discovers the plugin (skills=1).In the app (macOS, hidden window, stand-in model): OpenCode and OMP chats drew the chart inline; with Inline visuals off, OpenCode got no skill and answered in plain text; Grok's process carried
--plugin-dir.Not verified: a real model choosing to draw a visual; a Grok chat drawing one (needs a signed-in Grok); denying the write (OpenCode didn't ask by default, so there was nothing to deny); the chart still showing after an app restart; Windows, Linux and SSH (code reading only).
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Reviewed in two rounds plus a final readiness pass; summary in the PR comments.
Agent skill upstream boundary
Notes
PI_CONFIG_FILES; neither path goes through a shell.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)