Classifier-backed approval policy for the local interactive TUI.
Per-run classifier_model value meaning "review with the main agent model".
An absent (or None) classifier_model only says the run carries no
preference, so the classifier keeps whatever the server resolved at startup
(--auto-classifier-model, DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL,
[models].auto_classifier). /auto model clear needs the stronger statement
that reviews go back to the main agent model, which this sentinel carries.
It cannot collide with a real spec: create_model resolves provider:model
(or a bare model name) and has no provider or model named __dcode_.... A
control character such as a leading NUL would also be collision-proof, but this
value has to survive the trip to a remote deployment intact — the context is
serialized to JSON and may be persisted, and Postgres text/jsonb rejects NUL
outright. A stripped sentinel would silently read as "no preference" and leave a
startup classifier authorizing actions after the UI reported the clear, so the
sentinel stays plain ASCII.
Default wall-clock budget for one Auto classifier decision batch.
Single source of truth shared by the manifest option, the middleware default, and the resolver, so the three cannot drift (pinned by test).
Return the store key for a thread's live approval mode.
Asynchronously read a live approval mode from a LangGraph Store.
The graph server supplies an async batched Store whose synchronous methods
reject calls from the event-loop thread. Prefer aget() for that runtime,
while retaining a synchronous fallback for lightweight local test stores.
Return a validated mode, failing closed to manual.
Project authoritative channels into deterministic notice state.
Build trusted classifier metadata for a client-created user message.
Return whether an MCP tool has coherent read-only annotations.
Return whether a tool carries dcode's MCP wrapper marker.
Return MCP names that require Manual or Auto review.
Return a compact reason safe for persistence, logs, and UI rendering.
Build a safe agent/UI reason for a failed auto classifier call.
Provider exception text stays out of the reason (it can carry secrets or
noisy HTML). Only real local deadline expiry
(_ClassifierDeadlineExceededError) says the classifier did not respond
within the configured wait budget; a bare provider TimeoutError stays
type-only so we do not claim dcode's deadline fired when the model failed
first. A configured classifier model that cannot be built is named as such
so the user fixes the setting instead of waiting out a nonexistent outage.
Tool-approval policy selected for an interactive thread.
Classifier denial categories exposed to the agent and TUI.
One structured classifier decision for a proposed tool call.
Validated classifier response for one unresolved action batch.
Server-owned denial and availability counters for one thread.
Checkpoint-safe disposition for one gated call.
Private checkpoint record joining model output to after-model routing.
Server-owned provenance for one exclusively allocated scratch file.
Reducer update that creates or removes one exact artifact record.
Agent state carrying private Auto decisions and scratch provenance.
Trusted metadata attached by the Textual client to a user message.
Apply deterministic policy, classifier review, and HITL fallback.
Reject dynamically gated MCP calls when no approval UI exists.