Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 1 addition & 24 deletions src/shared/agent-session-failure-words.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
type AgentSessionFailureCopyValues,
type AgentSessionFailureSay
} from './agent-session-failure-copy'
import type { AgentSessionWireRefusalCode } from './agent-session-wire-refusals'
import { START_REFUSAL_RESUMABLE } from './agent-session-wire-refusals'
import { providerRetryWords, withRetryCause } from './agent-session-provider-retry-words'
import { commandRefusedByReason } from './agent-session-command-refusal-words'
import { joinSentences } from './sentence-joining'
Expand Down Expand Up @@ -73,29 +73,6 @@ export type AgentSessionFailureWordsContext = {
messageSubmitted?: boolean
}

/**
* Whether a refused start leaves the chat anything to start again from. `false`: this host has
* nothing to restart it from — no record, or none it can run — so only a new chat continues.
* A new wire code does not compile until it is classified here.
*/
export const START_REFUSAL_RESUMABLE: Record<AgentSessionWireRefusalCode, boolean> = {
execution_owner_reconciling: true,
agent_session_conflict: true,
agent_session_checkpoint_stale: true,
agent_session_ownership_unknown: true,
agent_session_operation_capacity: true,
structured_agent_session_unsupported: false,
agent_session_operation_conflict: true,
agent_session_operation_expired: true,
agent_session_operation_invalid: true,
agent_session_operation_unknown: true,
agent_session_item_revision_stale: true,
agent_session_already_resolved: true,
agent_session_identity_required: false,
agent_session_journal_unreadable: true,
agent_session_owner_restart_failed: true
}

/** Person-facing provider text is quoted, but bounded so the sentence stays one. */
const MAX_QUOTED_DETAIL_CHARS = 512
const BYTES_PER_MB = 1024 * 1024
Expand Down
23 changes: 23 additions & 0 deletions src/shared/agent-session-wire-refusals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ export const AGENT_SESSION_WIRE_REFUSAL_CODES = [
] as const
export type AgentSessionWireRefusalCode = (typeof AGENT_SESSION_WIRE_REFUSAL_CODES)[number]

/**
* Whether a refused start leaves the chat anything to start again from. `false`: this host has
* nothing to restart it from — no record, or none it can run — so only a new chat continues.
* A new wire code does not compile until it is classified here.
*/
export const START_REFUSAL_RESUMABLE: Record<AgentSessionWireRefusalCode, boolean> = {
execution_owner_reconciling: true,
agent_session_conflict: true,
agent_session_checkpoint_stale: true,
agent_session_ownership_unknown: true,
agent_session_operation_capacity: true,
structured_agent_session_unsupported: false,
agent_session_operation_conflict: true,
agent_session_operation_expired: true,
agent_session_operation_invalid: true,
agent_session_operation_unknown: true,
agent_session_item_revision_stale: true,
agent_session_already_resolved: true,
agent_session_identity_required: false,
agent_session_journal_unreadable: true,
agent_session_owner_restart_failed: true
}

/** For a host path that raises its refusal as the thrown code. Narrowing through this keeps an
* unrelated fault from being reported to the client as a tidy, wrong refusal. */
export function isAgentSessionWireRefusalCode(
Expand Down
Loading