Skip to content

[front] Record publishing agent on Frames v2 publications - #32284

Open
davidebbo wants to merge 1 commit into
mainfrom
fix-frame-v2-publish-agent-id
Open

[front] Record publishing agent on Frames v2 publications#32284
davidebbo wants to merge 1 commit into
mainfrom
fix-frame-v2-publish-agent-id

Conversation

@davidebbo

Copy link
Copy Markdown
Contributor

Summary

useVisualizationRetry's canRetry gate (and therefore the "Ask agent to fix" button on a Frame runtime error) requires useCaseMetadata.lastEditedByAgentConfigurationId to be set. The legacy Frame publish path (publishFrame) has always recorded this field on publish. The Frames v2 publish/activation path never did: publishFrameFromSource received publishedByAgentConfigurationId from the sandbox /publish route but dropped it on the frame.isFrameV2 branch instead of forwarding it into publishFrameV2FromSource, so it never reached activateFramePublication / FileResource.setActiveFramePublication, which writes useCaseMetadata.

As a result, no Frames v2 file ever got lastEditedByAgentConfigurationId set, so "Ask agent to fix" could never appear for a Frames v2 runtime error, in any conversation.

This threads publishedByAgentConfigurationId through the full v2 activation chain (publishFrameFromSourcepublishFrameV2FromSourcebuildAndPublishFramePublicationpublishFramePublicationactivateFramePublicationFileResource.setActiveFramePublication) and has the last step write lastEditedByAgentConfigurationId into useCaseMetadata, matching the legacy path's behavior.

Also adds a code contract on setActiveFramePublication documenting this invariant, since it was previously undocumented and silently broken.

Test plan

  • npx tsgo --noEmit passes
  • npm run format:changed / biome check passes
  • cc-check format / cc-check list validate the new contract
  • Manually verified locally: republished a Frames v2 file with a runtime error and confirmed the "Ask agent to fix" button now appears

Frames v2 publish/activation never threaded publishedByAgentConfigurationId
through to useCaseMetadata.lastEditedByAgentConfigurationId, unlike the legacy
Frame publish path. Since the conversation UI's "Ask agent to fix" button on a
Frame runtime error depends on that field, it could never appear for any
Frames v2 error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant