Skip to content

fix(agent-panel): recover prompt submits failures - #10818

Merged
Light2Dark merged 1 commit into
marimo-team:mainfrom
julio4:fix/acp-prompt-submission-errors
Sep 15, 2026
Merged

Light2Dark merged 1 commit into
marimo-team:mainfrom
julio4:fix/acp-prompt-submission-errors

Conversation

@julio4

@julio4 julio4 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

📝 Summary

Fix two failure paths in the acp agent panel prompt-submission handler:

  • Submitting from an unnamed notebook previously cleared the draft and attachments, changed the session title, and left the panel busy before returning with the existing naming warning. Validate the filename before mutating submission state so the user can name the notebook and submit again.
  • Rejected agent prompts were only logged to the console. Instead we can log them in the existing error banner, preserving JSON-RPC authentication errors and their existing recovery action. Include prompt preparation inside same try/catch/finally so preparation failures also release loading state.

These failure paths were encountered while embedding acp-based cell. This change fixes the shared handler for both composer submissions and queued prompts; it adds no downstream-specific behavior, dependencies, or configuration.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 13, 2026 3:55pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@julio4

julio4 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@mscolnick

Copy link
Copy Markdown
Contributor

@cubic-dev-ai

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai

@mscolnick I have started the AI code review. It will take a few minutes to complete.

@Light2Dark Light2Dark added the bug Something isn't working label Sep 15, 2026

@Light2Dark Light2Dark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good, tq!

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/chat/acp/agent-panel.tsx">

<violation number="1" location="frontend/src/components/chat/acp/agent-panel.tsx:907">
P2: When an unnamed notebook consumes a queued `pendingPrompt.submit`, this check returns after the effect has already cleared `pendingAiPromptAtom`, so the prompt is lost. Validate queued prompts before clearing them or restore the pending prompt on this failure.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic


let absoluteFilename: string;
try {
absoluteFilename = getAbsoluteFilename();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When an unnamed notebook consumes a queued pendingPrompt.submit, this check returns after the effect has already cleared pendingAiPromptAtom, so the prompt is lost. Validate queued prompts before clearing them or restore the pending prompt on this failure.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/chat/acp/agent-panel.tsx, line 907:

<comment>When an unnamed notebook consumes a queued `pendingPrompt.submit`, this check returns after the effect has already cleared `pendingAiPromptAtom`, so the prompt is lost. Validate queued prompts before clearing them or restore the pending prompt on this failure.</comment>

<file context>
@@ -902,6 +902,18 @@ const AgentPanel: React.FC = () => {
 
+      let absoluteFilename: string;
+      try {
+        absoluteFilename = getAbsoluteFilename();
+      } catch {
+        toast({
</file context>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing issue

@Light2Dark
Light2Dark merged commit 35411d7 into marimo-team:main Sep 15, 2026
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants