Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
5ff60af
fix(native-chat): identify the owner when resume create is refused
brennanb2025 Oct 15, 2026
8256fa6
test(native-chat): consolidate transcript refusal cases
brennanb2025 Oct 15, 2026
0ebb6f4
test(native-chat): keep ownership coverage at the launch boundary
brennanb2025 Oct 15, 2026
1e649eb
test(native-chat): update adoption fixture for early ownership admission
brennanb2025 Oct 15, 2026
19a79bf
test(native-chat): align resume admission assertions with host ownership
brennanb2025 Oct 15, 2026
92e4773
test(native-chat): keep RPC coverage focused on ownership proof
brennanb2025 Oct 15, 2026
bd557bf
test(native-chat): assert blank request presence before optional source
brennanb2025 Oct 15, 2026
4ce33f9
fix(native-chat): admit the actual CLI source during chat creation
brennanb2025 Oct 15, 2026
1a2a3f7
fix(native-chat): satisfy source admission lint checks
brennanb2025 Oct 15, 2026
eec3ff8
test(native-chat): provide the waiting hook prompt
brennanb2025 Oct 15, 2026
8fbcdac
test(native-chat): isolate source admission fixtures from host homes
brennanb2025 Oct 15, 2026
1103026
test(native-chat): canonicalize adoption fixture directories
brennanb2025 Oct 15, 2026
7cf362c
test(native-chat): preserve early ownership admission in source stack
brennanb2025 Oct 15, 2026
de7b566
Resume CLI conversations directly in native chat
brennanb2025 Oct 15, 2026
2a17fbb
fix(native-chat): preserve resume refusal behavior and honest transcr…
brennanb2025 Oct 15, 2026
876c72c
fix(native-chat): retain import read evidence in typed result
brennanb2025 Oct 15, 2026
17d63f7
Use the header test fixture record type
brennanb2025 Oct 15, 2026
e899665
Consolidate launch owner imports and correct feedback assertion
brennanb2025 Oct 15, 2026
3bb26b8
Keep existing resume translation in runtime catalog
brennanb2025 Oct 15, 2026
c846967
Merge commit '876c72ce9ab1c563a21cbd2b1b4b6daae8215002' into brennanb…
brennanb2025 Oct 15, 2026
837aea0
fix(native-chat): preserve admitted source and prepared execution home
brennanb2025 Oct 15, 2026
3ee200d
fix(chat): retain source evidence for dispatched adoption
brennanb2025 Oct 15, 2026
8cd662b
fix(chat): keep source capture within module limits
brennanb2025 Oct 15, 2026
4440b5b
Keep deferred chat publication in the shared launch owner
brennanb2025 Oct 15, 2026
a836a6c
test(chat): allow host evidence in create routing
brennanb2025 Oct 15, 2026
09b29bc
Satisfy launch publication checks and scope slot cleanup
brennanb2025 Oct 15, 2026
2da98ed
Preserve canonical tab membership on projected reorders
brennanb2025 Oct 15, 2026
8a8a8a9
Use recorded launch ownership for surface recovery
brennanb2025 Oct 15, 2026
02ebb2e
Reserve deferred chat order through existing group actions
brennanb2025 Oct 15, 2026
e451267
Merge reviewed source admission branch into CLI resume
brennanb2025 Oct 15, 2026
a6c1581
Pass the active layout owner into launch cancellation
brennanb2025 Oct 15, 2026
9ce2f30
fix(native-chat): admit an unsaved transcript under a linked account …
brennanb2025 Oct 16, 2026
6634a11
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
88d5f53
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-a-ow…
brennanb2025 Oct 16, 2026
9bf2229
Merge remote-tracking branch 'origin/brennanb2025/rcc-a-owner-refusal…
brennanb2025 Oct 16, 2026
5bdfe33
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
9baf0ad
refactor(native-chat): move the newest-item import window into its ow…
brennanb2025 Oct 16, 2026
7ccd571
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
aadb207
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-a-ow…
brennanb2025 Oct 16, 2026
0aef11d
fix(native-chat): restore the refusal error import lost in the main m…
brennanb2025 Oct 16, 2026
28b50c9
Merge remote-tracking branch 'origin/brennanb2025/rcc-a-owner-refusal…
brennanb2025 Oct 16, 2026
51a3c41
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
370d6b7
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-a-ow…
brennanb2025 Oct 16, 2026
6676f7a
Merge remote-tracking branch 'origin/brennanb2025/rcc-a-owner-refusal…
brennanb2025 Oct 16, 2026
ccdfcd6
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
a2e56d3
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-b-so…
brennanb2025 Oct 16, 2026
b5ecb6b
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
92ae7c0
test(native-chat): pass the layout owner in the layout-owner cancel test
brennanb2025 Oct 16, 2026
9f3adee
fix(native-chat): admit Pi transcripts against the root Session Histo…
brennanb2025 Oct 16, 2026
ea91dab
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
1a6d44a
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-b-so…
brennanb2025 Oct 16, 2026
7d3e74c
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 16, 2026
0fdce13
refactor(native-chat): admit and look up CLI transcripts in one store…
brennanb2025 Oct 17, 2026
ba1dd8f
Merge remote-tracking branch 'origin/brennanb2025/rcc-b-source-admiss…
brennanb2025 Oct 17, 2026
9495796
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-c-cl…
brennanb2025 Oct 17, 2026
56b78b7
fix(native-chat): keep a History resume that joins a terminal resume …
brennanb2025 Oct 17, 2026
26656f5
refactor(native-chat): move the launch source hand-off into its own m…
brennanb2025 Oct 17, 2026
dfc3948
Merge remote-tracking branch 'origin/main' into brennanb2025/rcc-c-cl…
brennanb2025 Oct 18, 2026
c818a61
fix: pick the chat that adopts a header resume the way History does
brennanb2025 Oct 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/main/ai-vault/ai-vault-local-scan-progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export function startLocalAiVaultScanProgress(
): LocalAiVaultScanProgressHandle {
const previous = latest.get(scanKey)
const fallback =
previous?.stage === 'finished'
? previous
: (currentScans.get(scanKey)?.fallback ?? null)
previous?.stage === 'finished' ? previous : (currentScans.get(scanKey)?.fallback ?? null)
let current: AiVaultScanProgress = {
scanId,
stage: 'finding',
Expand Down
5 changes: 4 additions & 1 deletion src/main/ai-vault/ai-vault-scan-coordinator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ describe('AiVaultScanCoordinator', () => {
})
})
await Promise.resolve()
expect(localAiVaultScanProgress('scope')).toMatchObject({ stage: 'finding', startedAt: 2_000 })
expect(localAiVaultScanProgress('scope')).toMatchObject({
stage: 'finding',
startedAt: 2_000
})
expect(stages).not.toContain(null)
finishPreparation?.(EMPTY_RESULT)
await expect(Promise.all([first, replacement])).resolves.toEqual([EMPTY_RESULT, EMPTY_RESULT])
Expand Down
5 changes: 4 additions & 1 deletion src/main/ai-vault/ai-vault-scan-progress-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ describe('Session History scan progress, scanner child to window', () => {

// A failed refresh puts back the last finished scan rather than leaving the key empty.
replacement.fail()
expect(localAiVaultScanProgress('scope')).toMatchObject({ scanId: 'earlier', stage: 'finished' })
expect(localAiVaultScanProgress('scope')).toMatchObject({
scanId: 'earlier',
stage: 'finished'
})
})

it('settles unfinished work when an interactive timeout retires the shared scanner', async () => {
Expand Down
5 changes: 4 additions & 1 deletion src/main/ai-vault/session-scanner-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ export async function forEachSessionFile(
options.signal?.throwIfAborted()
// Why: a gate refusal means the scan could not run, not that the tree is
// empty — swallowing it would misreport a stalled distro as "no transcript".
if (error instanceof WslTranscriptFsError || (options.strictErrors && !isMissingSidecarError(error))) {
if (
error instanceof WslTranscriptFsError ||
(options.strictErrors && !isMissingSidecarError(error))
) {
throw error
}
return
Expand Down
5 changes: 4 additions & 1 deletion src/main/ai-vault/session-scanner-scope-walk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ it('uses a cold parsed latest Codex cwd after its unlisted row is evicted', asyn
const scan = () =>
scanAiVaultSessions({ ...roots, platform: 'linux', limit: 1, scopePaths: ['/repo'] })
expect((await scan()).sessions.some((row) => row.filePath === path)).toBe(false)
const parsed = await parseAgentSessionFileCached({ agent: 'codex', file, codexHome: null }, 'linux')
const parsed = await parseAgentSessionFileCached(
{ agent: 'codex', file, codexHome: null },
'linux'
)
expect(rows.get(path)?.session?.cwd).toBe('/repo')
for (let index = 0; index <= MAX_UNLISTED_ENTRIES; index++) {
storeSessionParseCacheEntry(`search-${index}`, {
Expand Down
7 changes: 6 additions & 1 deletion src/main/ai-vault/session-scanner-zcode-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export function zcodeDiscoveries(
list(),
scopeWalksAgentFiles('zcode', options.scopePaths) ? list(options.scopePaths) : undefined
])
return { agent: 'zcode' as const, rootDir: dbPath, files, ...(scopeFiles ? { scopeFiles } : {}) }
return {
agent: 'zcode' as const,
rootDir: dbPath,
files,
...(scopeFiles ? { scopeFiles } : {})
}
})
}

Expand Down
6 changes: 5 additions & 1 deletion src/main/ai-vault/session-scanner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AiVaultListResult, AiVaultScanIssue, AiVaultSession } from '../../shared/ai-vault-types'
import type {
AiVaultListResult,
AiVaultScanIssue,
AiVaultSession
} from '../../shared/ai-vault-types'
import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host'
import { withSpan } from '../observability/tracer'
import { sessionSortTime } from './session-scanner-accumulator'
Expand Down
7 changes: 4 additions & 3 deletions src/main/ai-vault/session-scope-cwd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export const AI_VAULT_SCOPE_CWD_SOURCES: Record<AiVaultAgent, SessionScopeCwdSou
codebuddy: { kind: 'bucket', layout: CODEBUDDY_CWD_BUCKET_LAYOUT },
codex: {
kind: 'head',
cwdOf: (record) =>
record.type === 'session_meta' ? asRecord(record.payload)?.cwd : undefined,
cwdOf: (record) => (record.type === 'session_meta' ? asRecord(record.payload)?.cwd : undefined),
// Its first record carries the base instructions (about 20 KB): one read, not two.
firstReadBytes: 64 * 1024
},
Expand Down Expand Up @@ -102,7 +101,9 @@ export async function readTranscriptHeadCwd(
const { cwdOf } = source
let cwd: string | null = null
const first = source.firstReadBytes ?? HEAD_READ_BYTES
for (const length of first < HEAD_WIDENED_READ_BYTES ? [first, HEAD_WIDENED_READ_BYTES] : [first]) {
for (const length of first < HEAD_WIDENED_READ_BYTES
? [first, HEAD_WIDENED_READ_BYTES]
: [first]) {
let head: Buffer
try {
head = await readTranscriptSlice(file.path, 0, length, 'scan', signal)
Expand Down
4 changes: 1 addition & 3 deletions src/main/antigravity/antigravity-acp-runtime-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { createAcpAgentConnection, type AcpAgentConnection } from '../acp/acp-agent-connection'
import type { InitializeResponse } from '../acp/generated/acp-protocol.generated'
import {
runAgentModelCatalogSession
} from '../native-chat/agent-model-catalog/agent-model-catalog-probe-runner'
import { runAgentModelCatalogSession } from '../native-chat/agent-model-catalog/agent-model-catalog-probe-runner'
import { ANTIGRAVITY_ACP_ENV, scrubAntigravityAcpEnvironment } from './antigravity-acp-environment'

const PROBE_TIMEOUT_MS = 90_000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export type StructuredAgentSessionMutationContext = {
publishChildWork: (sessionId: string, evidence: AgentChildWorkEvidence[]) => void
/** What the live child holds changed with no row (`publishGenerationEnded`). */
publishWorkChanged: (sessionId: string) => void
captureChildWorkStops: (
sessionId: string,
handleIds: readonly string[]
) => CapturedChildWorkStops
captureChildWorkStops: (sessionId: string, handleIds: readonly string[]) => CapturedChildWorkStops
/** Some of the session's running child work has no record. */
childWorkOpen: (sessionId: string) => boolean
childWorkIncomplete: (sessionId: string) => boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ export class StructuredAgentSessionOpenChildWork {
return session?.open.has(handleId) ? session.history.get(handleId)?.token : undefined
}

matches(sessionId: string, handleId: string, captured: ChildWorkLifetimeToken | undefined): boolean {
matches(
sessionId: string,
handleId: string,
captured: ChildWorkLifetimeToken | undefined
): boolean {
return this.capture(sessionId, handleId) === captured
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ export class StructuredAgentSessionStatusFeed {
captureChildWorkStops = (
sessionId: string,
handleIds: readonly string[]
): CapturedChildWorkStops =>
this.ownership.captureChildWorkStops(sessionId, handleIds)
): CapturedChildWorkStops => this.ownership.captureChildWorkStops(sessionId, handleIds)

/** Reads the store, so a failing read costs only the strip's note, as `readChildWork`'s does. */
childWorkIncomplete = (sessionId: string): boolean => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,4 @@ describe('child work the provider reported, recorded or not', () => {
expect(owner.childWorkIncomplete(summary.sessionId)).toBe(true)
expect(captured.current('helper')).toBe(false)
})

})
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ export class StructuredAgentSessionStatusOwnership {
}

/** A Stop's callback closes only lifetimes captured before the provider call can await. */
captureChildWorkStops(
sessionId: string,
handleIds: readonly string[]
): CapturedChildWorkStops {
captureChildWorkStops(sessionId: string, handleIds: readonly string[]): CapturedChildWorkStops {
const captured = new Map<string, ChildWorkLifetimeToken | undefined>()
for (const handleId of handleIds) {
captured.set(handleId, this.open.capture(sessionId, handleId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,12 @@ describe('performCancel', () => {
const accepting = new Promise<void>((resolve) => {
acceptStop = resolve
})
const stopBackgroundTasks = vi.fn(async (request: { acknowledge: (value: { taskId: string }) => void }) => {
request.acknowledge({ taskId: 'helper' })
return { cancelled: true }
})
const stopBackgroundTasks = vi.fn(
async (request: { acknowledge: (value: { taskId: string }) => void }) => {
request.acknowledge({ taskId: 'helper' })
return { cancelled: true }
}
)
const ctx = acceptedStop({
logger: createStructuredAgentSessionLogger(),
sessionId: 'session-1',
Expand All @@ -320,8 +322,14 @@ describe('performCancel', () => {
const stopping = runTargetedCancel(ctx, {
clientOperationId: 'stop-earlier-lifetime',
scope: 'background-tasks',
childWork: () => [liveTask('helper', { invocation: { invocationId: 'spawn-a', generation: 1 } })],
captureStops: (targets) => owner.captureChildWorkStops('session-1', targets.map((target) => target.providerId)),
childWork: () => [
liveTask('helper', { invocation: { invocationId: 'spawn-a', generation: 1 } })
],
captureStops: (targets) =>
owner.captureChildWorkStops(
'session-1',
targets.map((target) => target.providerId)
),
acknowledgeStops: (evidence) => owner.publishChildWork('session-1', evidence, 'claude')
})
expect(stopBackgroundTasks).not.toHaveBeenCalled()
Expand Down Expand Up @@ -414,7 +422,10 @@ describe('performCancel', () => {
scope: 'background-tasks',
childWork: () => owner.readChildWork('session-1'),
captureStops: (targets) =>
owner.captureChildWorkStops('session-1', targets.map((target) => target.providerId)),
owner.captureChildWorkStops(
'session-1',
targets.map((target) => target.providerId)
),
acknowledgeStops: (evidence) => owner.publishChildWork('session-1', evidence, 'claude'),
unlisted: { present: () => owner.childWorkIncomplete('session-1'), stop: stopAgent }
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ export function unfinishedStructuredAgentSessionWorkWasInterrupted(
): boolean {
const currentSnapshot = journal.snapshot()
if (
journal.submissions?.().some(
(send) =>
heldSends?.has(send.clientMessageId) &&
send.fence === exit?.ownerFence &&
!isQueuedAgentJournalSubmission(send) &&
(send.dispatchState === 'pending' || send.dispatchState === 'unknown')
) ||
journal
.submissions?.()
.some(
(send) =>
heldSends?.has(send.clientMessageId) &&
send.fence === exit?.ownerFence &&
!isQueuedAgentJournalSubmission(send) &&
(send.dispatchState === 'pending' || send.dispatchState === 'unknown')
) ||
currentSnapshot.items.some(isInProgressStructuredAgentSessionItem)
) {
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,37 +92,47 @@ describe('conversationCommandBlocked background work', () => {

it('waits on running work the store has no record of', () => {
const unrecorded = { views: [SETTLED], open: true }
expect(conversationCommandBlocked(contextWith(TARGETED), RECORD, unrecorded)?.message).toBe(WAIT)
expect(conversationCommandBlocked(contextWith(TARGETED), RECORD, unrecorded)?.message).toBe(
WAIT
)
})

it('asks for a stop when the strip offers one on a live row', () => {
expect(
conversationCommandBlocked(contextWith(TARGETED), RECORD, reading([SETTLED, child()]))?.message
conversationCommandBlocked(contextWith(TARGETED), RECORD, reading([SETTLED, child()]))
?.message
).toBe(STOP)
})

it('asks for a stop when the strip offers its single untargeted stop', () => {
const live = child({ stoppable: false })
expect(conversationCommandBlocked(contextWith(UNTARGETED), RECORD, reading([live]))?.message).toBe(STOP)
expect(
conversationCommandBlocked(contextWith(UNTARGETED), RECORD, reading([live]))?.message
).toBe(STOP)
})

it('asks the user to wait when no live row on the strip has a stop', () => {
// A targeted-stop provider renders no untargeted stop, so these rows offer nothing.
const unstoppable = child({ stoppable: false })
const unaddressable = child({ id: 'child-2', providerId: undefined })
expect(
conversationCommandBlocked(contextWith(TARGETED), RECORD, reading([unstoppable, unaddressable]))
?.message
conversationCommandBlocked(
contextWith(TARGETED),
RECORD,
reading([unstoppable, unaddressable])
)?.message
).toBe(WAIT)
})

it('asks the user to wait when the provider exposes no stop at all', () => {
// Codex: an instruction to stop would name a control that does not exist.
expect(conversationCommandBlocked(contextWith(NO_STOP), RECORD, reading([child()]))?.message).toBe(WAIT)
expect(
conversationCommandBlocked(contextWith(NO_STOP), RECORD, reading([child()]))?.message
).toBe(WAIT)
// No live provider session answers for it either.
expect(conversationCommandBlocked(contextWith(undefined), RECORD, reading([child()]))?.message).toBe(
WAIT
)
expect(
conversationCommandBlocked(contextWith(undefined), RECORD, reading([child()]))?.message
).toBe(WAIT)
})

it('still refuses on the open turn, not on the work the strip now shows', () => {
Expand Down
14 changes: 8 additions & 6 deletions src/main/native-chat/structured-agent-cli-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ export function captureStructuredAgentCliSource(
try {
return Object.freeze({
rows: Object.freeze(
readRows().map((row) => Object.freeze({
...row,
...(row.providerSession
? { providerSession: Object.freeze({ ...row.providerSession }) }
: {})
}))
readRows().map((row) =>
Object.freeze({
...row,
...(row.providerSession
? { providerSession: Object.freeze({ ...row.providerSession }) }
: {})
})
)
)
})
} catch (error) {
Expand Down
Loading
Loading