Repository navigation
feat: agents open files in the side-panel Preview (amicode_open_preview) + 16 MB HTML cap (#2130) - #2156
Draft
jacktrnr wants to merge 3 commits into
Draft
feat: agents open files in the side-panel Preview (amicode_open_preview) + 16 MB HTML cap (#2130)#2156jacktrnr wants to merge 3 commits into
jacktrnr wants to merge 3 commits into
Conversation
added 3 commits
November 8, 2026 09:59
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
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.
Closes #2130.
Agents can now put a file in the side-panel Preview themselves, so a live campaign dashboard shows up next to the conversation automatically instead of the session running
open -a "Google Chrome" …. It also raises the Preview's size limit for HTML pages, so dashboards that embed their plots render instead of showing "File too large to preview".What changed
The agent tool,
amicode_open_preview(packages/extension/opencode-plugin/preview_open.ts)src/amicode_tools_core.ts) and the plugin twin, so the parity test keeps them in step.~/…andfile://), checks the file exists, and returns anAMICODE_PREVIEW {path,name,bytes}sentinel as its last line.The app side (
ui/src/amicode/card.tsx,preview-open.ts,preview-open-card.tsx)AmicodeToolCardwatches the part. When anamicode_open_previewcall it saw live (pending or running) completes, it posts the existing session-targetedpreview-fileopen, withrefresh: true. This happens once per part.The Preview (
app/src/components/session/preview-file-view.tsx,preview-file-helpers.ts)preview-filemessage withrefresh: truefor the file a view already shows makes that view re-read it. This matters for files outside the project, which the engine's watcher never reports.rereadFromDiskso both paths share it.Guidance for agents
AGENTS.mdtells agents to show results withamicode_open_previewand never an external browser.file://link once.Verification
pnpm --filter amicode test: 5824 passed, 0 failed on a clean run../.notturno/gates(baseorigin/main): drift, typecheck and build pass. The only red was one of the 10 MB SSE frame-splitting timing tests (linear_sse_frame_splitting_1790,sse_fanin_driver_pump); a different one failed on each run. They are not touched by this diff, pass when re-run, and the machine was at load average ~35 from unrelated Julia jobs.bun):typecheckis clean for both;src/components/session: 291 tests pass;src/amicode: 444 tests pass, including the newpreview-open.test.ts.PASSafterrefresh_manifest.bin/dist/mcp-amico.mjsand drove it over stdio.tools/listservesopen_preview.Notes
AGENTS.mdboth say the Preview strips scripts and<meta http-equiv=refresh>. Agents stop relying on those and write plots as files.preview-file(Extension → Preview bridge (sidebar routing) #934/fix(app): preview-open bleeds across sessions (un-targeted broadcast + prewarmed views) #1648) with an extrarefreshfield. Older listeners ignore that field and just open the file.