Repository navigation
FE-1667: Run experiments from Petrinaut AI chat - #9678
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview The assistant panel runs the tool client-side: progress and cancellation state per tool call, a single automatic tool result when the host finishes, and abort on stop/clear/conversation change. Chat renders a dedicated
User and architecture docs, changesets, and unit/integration test updates align with the new flow. Reviewed by Cursor Bugbot for commit 97a299e. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
AI optimization currently bypasses the required Parameter sweeps feature flag.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds AI-driven Petrinaut experiments with live progress, cancellation, result cards, and persistent chat across editor modes.
Changes:
- Registers and executes
createExperiment. - Adds experiment cards, lifecycle handling, and tests.
- Updates architecture docs, user guides, and changesets.
File summaries
| File | Description |
|---|---|
libs/@local/petrinaut-arch-docs/content/experiments/ai-created-experiments.mdx |
Links browser-host and chat architecture. |
libs/@local/petrinaut-arch-docs/content/diagrams/ai-experiment-chat.d2 |
Adds chat experiment flow diagram. |
libs/@local/petrinaut-arch-docs/content/ai/experiment-chat.mdx |
Documents chat integration. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/types.ts |
Adds experiment tool message types. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/README.md |
Declares the AI panel architecture layer. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/format-diagnostics-for-ai.ts |
Clarifies experiment compilation behavior. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/format-diagnostics-for-ai.test.ts |
Updates diagnostics expectation. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/ai-assistant-contents/get-message-render-items.ts |
Routes experiment parts to cards. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/ai-assistant-contents/experiment-card.tsx |
Implements progress and result cards. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/ai-assistant-contents/experiment-card.test.tsx |
Tests card states and progress. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/ai-assistant-contents.tsx |
Renders experiment state and controls. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel.tsx |
Dispatches and manages experiment requests. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel.test.tsx |
Tests experiment lifecycle integration. |
libs/@hashintel/petrinaut/src/ui/views/Editor/editor-view.tsx |
Keeps chat mounted across modes. |
libs/@hashintel/petrinaut/src/ui/views/Editor/editor-view.test.tsx |
Verifies persistent panel mounting. |
libs/@hashintel/petrinaut/docs/experiments.md |
Documents assistant-created experiments. |
libs/@hashintel/petrinaut/docs/ai-assistant.md |
Documents chat experiment workflows. |
libs/@hashintel/petrinaut-core/src/index.ts |
Exports the experiment tool name. |
libs/@hashintel/petrinaut-core/src/ai.ts |
Registers the canonical tool schema. |
.changeset/small-experiments-chat.md |
Records the Petrinaut package change. |
.changeset/experiment-ai-tool.md |
Records the core package change. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 1
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b090aa6 to
0755061
Compare
The merge-base changed after approval.
b25d845 to
17833c9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 17833c9. Configure here.
17833c9 to
cd7f9cf
Compare
cd7f9cf to
97a299e
Compare

Important
Experimental optimization
Optimization requires Parameter sweeps and In-browser optimization. Simulation is available without these flags.
Summary
Petrinaut AI can create experiments through the browser host and show their progress in the conversation. A compact card provides cancellation, the final metric, and a link to the experiment drawer.
The conversation stays mounted while the user inspects an experiment. Completion returns one captured tool result with the original call ID.
Links
Blocked by
Changes
createExperimentwith its canonical schema and dispatch it from the AI panelKnown issues
The additional Brunch
test:root-creationandtest:typed-statebrowser scripts stop atUnknown admitted browser observation callbefore reaching the changed diagnostic assertions. Those two runs are not counted as passing coverage.Test coverage
The AI request schema now imports from the contract module, without the worker backend. The inherited bundler regression reproduced the HASH Edge deployment failure and passes with this import fixed.
After the 15 September restack onto main
a898a13810, core, editor, website, and Brunch builds, unit tests, TypeScript, and lint passed on the integrated stack (52 tasks). Architecture validation, the documentation site build, and changed-file formatting passed. The 96 focused tests cover experiment cards, panel execution, and title editing.The earlier browser compiler-repair test passed through invalid code, repair, an unchanged diagnostic result, and recorded layout using installed Playwright Chromium. That run and the existing recordings predate this restack.
How to test
yarn workspace @hashintel/petrinaut test:unit --run src/ui/views/Editor/panels/ai-assistant-panel.test.tsx src/ui/views/Editor/panels/ai-assistant-panel/ai-assistant-contents/experiment-card.test.tsx src/ui/views/Editor/editor-view.test.tsx