Repository navigation
fix(artifacts): an interactive artifact calls its agent's API outside its agent's chat - #6738
Open
dam-application[bot] wants to merge 2 commits into
Open
dam-application[bot] wants to merge 2 commits into
dam-application[bot] wants to merge 2 commits into
Conversation
… its agent's chat The standalone page (Open in new tab) and the Artifacts library dock ArtifactPanel with agentId=null, which closed the whole bridge, so the frame relayed no Agent API requests and the page's server answered 401. Split the Agent API condition out of canUseArtifactBridge: the relay now needs only the latest version of a non-public interactive HTML page an Agent published; sending a prompt into the chat still needs that chat. Fixes #6737 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🛡️ Code Guardian 🛡️ — 9825756
PR #6738: fix(artifacts): an interactive artifact calls its agent's API outside its agent's chat
Author: dam-application[bot] | Branch: fix/6737-artifact-standalone-agent-api → main | Changes: +229 −21 (6 files)
Summary
The PR splits the Agent API gate out of canUseArtifactBridge, so a page calls its Agent outside that Agent's chat. Prompts into the open chat keep the old gate.
2 suggestion(s) dropped under the 🟢 budget.
Findings
- 🟡 Warning: Two in-tree statements still say that
requestworks only beside the publishing Agent's chat. Theplatform-artifactsskill tells agents that elsewhere in the app the call times out after 3 minutes. The architecture page says that the preview outside that chat sends no requests. Agents build pages from that skill, so they design for a failure that no longer occurs. Reported by Documentation Check (doc-drift). (packages/agents/base/rootfs/app/working-dir/.agents/skills/platform-artifacts/SKILL.md:127,docs/architecture/artifact-library.md:84).
Fix: State in both places thatrequestandwhoamiwork wherever the owner opens the latest version in the app. Then regenerate the skill's entry indam-skill-manifest.json. - ✅ Looks good: The new panel test fails 4 of 6 cases on
mainand passes at HEAD. The api-server still checks owner, kind, interactivity and visibility on every relayed call.
Documentation Check (doc-drift)
✅ No findings.
Issue Fit
✅ No findings.
TypeScript Engineering Review
✅ No findings.
React UI Engineering Review
- 🟢 Suggestion:
canUseArtifactBridgenow gates only a prompt into the open chat, but its name still says "the bridge". The panel renames its result tochatPromptOpento stay readable. A name such ascanSendArtifactChatPromptstops a later caller from gatingrequestwith it again. (packages/ui/src/modules/artifacts/components/artifact-panel.tsx:121).
Verdict
COMMENT — The code change is correct, but the agent-facing skill still states the old rule for request.
Review by Code Guardian 🛡️ · automated code guardian · ibm/aws/claude-opus-5-5 on pi
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.
What and why
An interactive HTML artifact opened with Open in new tab (
/artifacts/<id>/view) could not reach its agent's Artifact API. The page's server answered 401 to every data request. The Artifacts library's docked panel had the same fault. Both places mountArtifactPanelwith no chat agent (agentId={null}), and that closed the whole bridge, the Agent API relay included.This change splits the Agent API condition out of
canUseArtifactBridge. The relay now needs only the latest version of a non-public interactive HTML page that an agent published. Sending a prompt into the open chat still needs that chat to be the publishing agent's.Reviewer guide
canUseArtifactAgentApi(artifact, version)gates the Agent API relay at every mount.canUseArtifactBridgeis now that condition plus "the open chat is the artifact's agent", and gates onlyonSendPrompt.canStartArtifactSessionreuses the new condition, as it was the same check.agentApiAccess). No new server path.agentIdinto the panel on the standalone page. That would also turn on send-prompt-to-chat with no chat, which the issue says must stay off.Scope
packages/ui/src/modules/artifacts/lib/artifact-bridge.ts— the split condition.packages/ui/src/modules/artifacts/components/artifact-panel.tsx— the relay uses the new condition;bridgeOpenis renamedchatPromptOpen.artifact-prompt.test.ts(condition withagentId=null), newartifact-panel-agent-api.test.ts(what the frame gets at each mount).docs/architecture/artifact-library.mdand the Artifact Bridge entry indocs/ubiquitous-language.mdsay where the relay works.Testing
mise run check: passed.mise run test: stopped at one vm-runner test,boot::tests::an_entry_holding_a_locked_file_is_kept_whole. It fails every time in this sandbox and this change does not touch vm-runner. The full UI suite then ran alone: 342 files, 2283 tests passed.mainfor the standalone page, a restricted artifact and the library panel (3 of 6 cases), and passes with the change.Fixes #6737
Written by this agent — https://dam-dev.apps.dam-cl.fmaas.res.ibm.com/a/agent-677ca492fbca62dd?s=5759df75-6a4e-4283-8674-27060cf88aeb
🤖 Generated with Claude Code