Files
archived-orca/src/main/runtime/agent-session-record-launch-directory.ts
T
Brennan Benson 9ae33a96f9 fix(native-chat): keep damaged chats readable without granting agent actions (#31931)
* fix(native-chat): validate saved next-fence floors before use

* WIP: separate saved conversation observations from runtime proof

* Consolidate duplicate imports for WIP compiler checkpoint

* Preserve saved conversation observations with strict runtime authority

* Consolidate session admission and catalog imports

* fix: align conversation observation contracts and fixtures

* test: update conversation observation and writer fixtures

* test: use checked host fixtures for structured workers

* fix(native-chat): bound conversation projection work per request

* test(native-chat): consolidate scale fixture imports

* test(native-chat): use checked scale fixture types

* test(native-chat): bound unreadable inventory traversal

* Test native CLI admission and durable reference reads

* test: bound cold conversation name subscription work

* test: distinguish native receipt probes from terminal identity

* test: retain exact mutation refusal recovery identity

* fix: explain agent conversation preparation refusals

* test: adapt remaining conversation readers and document CLI timeout

* fix: register preparation refusal English message

* test: align conversation fixtures with checked read APIs

* test(native-chat): use checked conversation in Codex fixture
2026-10-26 13:16:41 -07:00

22 lines
875 B
TypeScript

import type { AgentSessionRecord } from '../../shared/agent-session-record'
import { isFloatingWorkspaceId } from '../../shared/floating-workspace-worktree'
/** First pin wins: resolving workspace settings again must not silently move an existing conversation. */
export function pinAgentSessionRecordLaunchDirectory(
record: AgentSessionRecord,
launchDirectory: string,
now: number
): AgentSessionRecord {
if (record.launchDirectory !== undefined) {
return record
}
return { ...record, launchDirectory, updatedAt: now }
}
/** Only floating ids need pinned paths; worktree/folder ids already name durable places. */
export function agentSessionPinnedLaunchDirectory(
record: Pick<AgentSessionRecord, 'launchDirectory' | 'location'>
): string | undefined {
return isFloatingWorkspaceId(record.location.workspaceId) ? record.launchDirectory : undefined
}