fix(workspaces): target remote launch option receipts

This commit is contained in:
Jinwoo-H
2026-08-09 23:41:22 -04:00
parent 1da44f4c59
commit 5c7cf60bf5
4 changed files with 15 additions and 5 deletions
+2 -1
View File
@@ -10346,7 +10346,8 @@
"assertions": [
"legacy hosts without acknowledgement cannot stamp client options as applied",
"client-built commands retain their known applied state",
"fallback agents own draft state without inheriting requested-agent options"
"fallback agents own draft state without inheriting requested-agent options",
"paired-runtime receipts target the authoritative web-surface agent tab"
]
}
],
@@ -755,6 +755,7 @@ describe('useComposerState host-context boundaries', () => {
'startupSessionOptions: { agent: tuiAgent, values: startupPlan.sessionOptions }'
)
expect(fullSubmit).toContain('resolveCreatedAgentAppliedSessionOptions')
expect(fullSubmit).toContain('resolveLaunchAgentTabId')
expect(fullSubmit).not.toContain('platform: CLIENT_PLATFORM')
const quickSubmit = sourceBetween(
+11 -3
View File
@@ -15,7 +15,10 @@ import {
} from '@/lib/github-links'
import { activateAndRevealWorktree, type AgentStartedTelemetry } from '@/lib/worktree-activation'
import { runBackgroundWorktreeCreation } from '@/lib/worktree-creation-flow'
import { resolveCreatedAgentAppliedSessionOptions } from '@/lib/worktree-creation-agent-seeds'
import {
resolveCreatedAgentAppliedSessionOptions,
resolveLaunchAgentTabId
} from '@/lib/worktree-creation-agent-seeds'
import {
findPendingLinkedWorkItemCreationId,
type WorktreeCreationRequest
@@ -3919,8 +3922,13 @@ export function useComposerState(options: UseComposerStateOptions): UseComposerS
backendSpawnedStartup && !backendStartup
? (worktree.createdWithAgent ?? tuiAgent)
: tuiAgent
const optionScopeKey =
(activation !== false ? activation.primaryTabId : null) ?? result.startupTerminal?.tabId
const optionScopeKey = resolveLaunchAgentTabId(useAppStore.getState(), {
agent: createdAgent,
worktreeId: worktree.id,
primaryTabId: activation === false ? null : activation.primaryTabId,
startupTerminalTabId: result.startupTerminal?.tabId,
backendSpawned: backendSpawnedStartup
})
if (optionScopeKey) {
seedNativeChatAppliedSessionOptions(
optionScopeKey,
@@ -38,7 +38,7 @@ export function resolveCreatedAgentAppliedSessionOptions(args: {
* (e.g. "dev server", "logs", "shell") the worktree's first tab runs no agent,
* and activation's `primaryTabId` is only the worktree's primary tab.
*/
function resolveLaunchAgentTabId(
export function resolveLaunchAgentTabId(
state: AppStoreSnapshot,
args: {
agent: TuiAgent