[front] Record publishing agent on Frames v2 publications - #32284
Open
davidebbo wants to merge 1 commit into
Open
[front] Record publishing agent on Frames v2 publications#32284davidebbo wants to merge 1 commit into
davidebbo wants to merge 1 commit into
Conversation
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.
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.
Summary
useVisualizationRetry'scanRetrygate (and therefore the "Ask agent to fix" button on a Frame runtime error) requiresuseCaseMetadata.lastEditedByAgentConfigurationIdto be set. The legacy Frame publish path (publishFrame) has always recorded this field on publish. The Frames v2 publish/activation path never did:publishFrameFromSourcereceivedpublishedByAgentConfigurationIdfrom the sandbox/publishroute but dropped it on theframe.isFrameV2branch instead of forwarding it intopublishFrameV2FromSource, so it never reachedactivateFramePublication/FileResource.setActiveFramePublication, which writesuseCaseMetadata.As a result, no Frames v2 file ever got
lastEditedByAgentConfigurationIdset, so "Ask agent to fix" could never appear for a Frames v2 runtime error, in any conversation.This threads
publishedByAgentConfigurationIdthrough the full v2 activation chain (publishFrameFromSource→publishFrameV2FromSource→buildAndPublishFramePublication→publishFramePublication→activateFramePublication→FileResource.setActiveFramePublication) and has the last step writelastEditedByAgentConfigurationIdintouseCaseMetadata, matching the legacy path's behavior.Also adds a code contract on
setActiveFramePublicationdocumenting this invariant, since it was previously undocumented and silently broken.Test plan
npx tsgo --noEmitpassesnpm run format:changed/biome checkpassescc-check format/cc-check listvalidate the new contract