fix(automations): scope Commit & Publish to the focused run + live publish activity - #894
Open
adriandemian wants to merge 2 commits into
Open
fix(automations): scope Commit & Publish to the focused run + live publish activity#894adriandemian wants to merge 2 commits into
adriandemian wants to merge 2 commits into
Conversation
When an automation run is focused, opening the publish pane, selecting artifact tabs, or focusing a changed file no longer resets the chat focus to the automation setup conversation, so the visible chat/agent and the publish surface stay bound to the run conversation's workspace. - Publish handlers in useAgentsViewController preserve automation_run focus and stamp publish file-focus requests with the run conversation id - useAgentsWorkspaceModel resolves the header publish shortcut workspace/freshness/label from the focused run's workspace and fails closed (hides the shortcut) while the run workspace is unresolved - New useAgentWorkspacePublishLiveRefresh hook polls publish queries (review/change-summary/diff/commits) every 2.5s while the workspace conversation is generating and runs one final refresh on settle - Terminal agent events also invalidate the workspace change-summary key - Regression tests: run-focus preservation, run-aware shortcut label, fail-closed suppression, two-run publish scope leakage, polling lifecycle
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
main, ported onto the current publish-shortcut architecture:useAgentsViewController→useAgentsWorkspaceModelthreading,focusedRunWorkspaceQuery, fail-closedsuppressPublishShortcutwhile the run workspace is unresolved).AgentsPublishPanelreads review/change-summary activity throughuseAgentPublishWorkspaceActivitywith a live refetch while a run is publishing, settling when idle (useAgentWorkspacePublishLiveRefresh).User Impact
While an automation run is focused, the Commit & Publish header shortcut and publish pane reflect that run's workspace and stay live while the run publishes — previously they could show the setup conversation's state or stale activity.
Technical Context
These originated on the skills branch (
a2c2c8f20/ #846 follow-up and4b504e98d) but were not included in the automation extraction tomain; the skills branch has now dropped them so it no longer touches automation surfaces. Ports were adapted tomain's evolved code: the per-conversation publish-attempt map keys by the focused run conversation, andworkspacePublishMode's persisted-PR check now evaluates the focused run's workspace so setup-workspace PR state doesn't leak into the run-scoped shortcut label.Risks / Follow-Ups
isPublishingWorkspaceusesmain's attempt-map rather than the originalpublishingConversationIdequality (that prop no longer exists); semantics reviewed as equivalent.var()colors fornotice-banner,automationRunView, and the automations listing accent (var(--accent-primary, #ff6b35)style), which the extraction dropped. Worth reconsidering separately given the WKWebView longhand/fallback rule.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.