H-6763: Add a generic Petrinaut composer submission API - #9355
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
7229e5d to
e15b65f
Compare
Expose stable host-owned composer controls, conversation identity, and schema-validated text mapping through the existing AI SDK chat path. Record the app-owned OpenAI voice boundary and the production contracts that gate rollout. Amp-Thread-ID: https://ampcode.com/threads/T-01a03fb3-fd3d-737f-b4c6-1fc9282950bf Co-authored-by: Amp <amp@ampcode.com>
Preserve automatic pending-tool correlation for ordinary submissions while letting explicit corrections bypass a pending interactive ask. Document and test the generic target contract at the Petrinaut boundary. Amp-Thread-ID: https://ampcode.com/threads/T-01a03fb3-fd3d-737f-b4c6-1fc9282950bf Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
lunelson
left a comment
There was a problem hiding this comment.
This is a clean split: Petrinaut gets a host control and one submission path, and provider/audio stay out. Sharing useChat between the keyboard and submitText is the right boundary for the rest of the stack.
One question on the public shape. fromComposerText plus the “exactly one pending mapped tool” rule in ai-assistant-panel.tsx (with target: "message" to opt out) reads like the brunch_ask interview turn, published as a generic Petrinaut contract. That’s fine if you expect other tools to need the same routing. If brunch_ask is the only caller, a narrower host API — complete this pending tool, or send a normal message — might age better than teaching every interactive tool how to parse composer text.
Approving as-is. Flagging it because this is the published seam the later PRs will be stuck with.
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 feaefa5. Configure here.
|
@lunelson Intentional: |
Only mark an abort as user-requested while a response is active, preventing a later incidental abort from showing a stale stopped state. Co-authored-by: Cursor <cursoragent@cursor.com>


🌟 What is the purpose of this PR?
Add a provider-neutral API for controls embedded in Petrinaut's AI composer. A host can submit finalized text—voice transcripts are the first consumer—through the same AI SDK conversation and correlated interactive-tool path used by keyboard submissions.
This PR deliberately contains no OpenAI, audio, or Brunch-specific runtime code.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
renderComposerControl, allowing an application-owned control to render beside the Petrinaut composer.submitTextandstopcallbacks.useChatID, whether supplied by the host or generated by the SDK.useChatinstance.target: "message"explicitly submits a normal message without consuming a pending tool, which supports later correction turns.fromComposerTextmapper.Stack record: direct base
359afceabaac841b8e6d88f877e5daaf92026528; #9345 head146d7895d41eaf7092571ff36b4b08bba7cc18ed; #9346 head359afceabaac841b8e6d88f877e5daaf92026528.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
The existing AI-assistant guide has no screenshot for this surface, so no screenshot is made stale.
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🐾 Next steps
🛡 What tests cover this?
ai-assistant-panel.test.tsx,ai-assistant-contents.test.tsx, and the interactive-tool registry tests cover effective/generated conversation identity, callback freshness, shared keyboard/control submission, stable IDs, mapping validation, correlated tool output, ambiguity, duplicate suppression, explicit message targeting, and stop behavior.Validation run
Results: 214 Petrinaut tests, 4 website tests, 12 transport tests, and 35 Brunch tests passed. Lint, typecheck, build, formatting, and architecture-doc checks passed. Transport emitted 4 inherited
no-await-in-loopwarnings and Brunch emitted 12 inherited warnings.The direct-base no-ElevenLabs audit and
git diff --checkpassed. No package, lockfile, environment, or deployment configuration changed. No provider credential check applies to this PR.❓ How to test this?
yarn workspace @hashintel/petrinaut test:unit --run src/ui/views/Editor/panels/ai-assistant-panel.test.tsx.target: "message"leaves a pending tool untouched.📹 Demo
Not applicable: this PR adds a host integration API without a new standalone user experience.