Use Agent Knock Knock to discover and control Codex CLI, Codex Desktop, or Claude Code conversations, and create Desktop conversations when its creation tool is available.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Agent Knock Knock?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/scotthuang-agent-knock-knock)
---
name: agent-knock-knock
description: Use Agent Knock Knock to discover and control Codex CLI, Codex Desktop, or Claude Code conversations, and create Desktop conversations when its creation tool is available.
---
# Agent Knock Knock
Use this skill when the user explicitly invokes `AKK`, `akk`, or `Agent Knock Knock`, or asks a supported controller Host to inspect or control a coding-agent conversation listed by AKK.
AKK supports loaded local Codex CLI threads through their shared backend, local Codex Desktop conversations (with explicit creation when the Desktop Create tool is available), compatible already-open Claude Code CLIs through their native inbox, and Codex or Claude Code already running inside tmux or local Herdr with the required operation capabilities. It never launches a replacement coding agent. The controller Host, AKK, the coding agent, and its Desktop app or terminal host must run as the same OS user.
Herdr `0.8.0` / protocol `19` and `0.9.5` / protocol `22` are tested baselines, not a version allowlist. Use fresh discovery and advertised actions: each pane's read capabilities are probed without input, while input requires a matching CLI schema declaration or verified baseline behavior. `matching_cli_schema` is declarative evidence from the same CLI version and server protocol, not runtime negotiation or proof of single-enqueue behavior. An untested server without that declaration exposes only verified reads; an incompatible declaration does not fall back to baseline behavior. Doctor installation readiness leaves live capabilities `not_probed`. Once input may have been dispatched, an uncertain response must not be retried automatically.
Treat `AKK` and `akk` the same way.
## Role
The controller Host interprets the user's request, sends the requested work into the selected conversation, handles actionable callbacks, and reports the outcome. The coding agent performs the engineering work in its existing CLI backend thread, Desktop conversation, or tmux/Herdr terminal.
Keep the user's requested scope and approval boundaries. Do not expand a task, approve a permission, interrupt a process, or close a managed record unless the user request or an explicit trusted policy authorizes that action.
A Codex `Folder access` / `Trust this folder?` dialog is a persistent local trust decision, not a command approval. When AKK reports `codex_folder_trust_required`, ask the user to resolve it in the original CLI and then refresh List/Status. Do not press Enter, alter trust configuration, switch to a backend to bypass it, or mistake backend `idle` for frontend readiness. AKK does not expose an automatic trust choice. A backend row's `backend_version` describes its server; `agent_version` is populated only from an exactly associated frontend and may differ or be absent.
## Choose a conversation
Present `conversations[]` as **CLI** or **Desktop** using `surface`, and keep Codex/Claude Code as the agent type. Select the displayed `conversation_id` and its advertised operation; AKK chooses the connection internally. Do not make separate user-facing backend and terminal lists, repeat raw discovery arrays, or count Watches as additional conversations or tasks. Preserve unavailable actions, current questions/approvals, and management/recovery records. Scoped controls, when present, are operations on exact targets within a row, not extra conversations.
Default List defers detailed approval, composer and native task scans. `detail_scan: deferred` or `approval_state.scanned: false` means the detail was not checked, not that no approval or input blocker exists. Use the advertised Status action for details; an explicit detailed scan is available through `noApprovalScan: false` (CLI `--approval-scan`). Send and other mutations still validate fresh target identity, input ownership and blockers before execution; List observations never authorize cached input.
Explain each row's observed state and offered actions in the user's language. Compact List v5 omits derived `usage`; use its readable state values, capability booleans, `available_actions`, dynamic `action_inputs` and current exceptions such as `manual_action`, and read exact Status when more explanation is needed. In v4, `usage.summary`, `available`, `limitations` and `next_steps` also provide display guidance. Guidance never grants authority or overrides `available_actions`; missing `usage` does not mean missing capability or monitoring. Keep `unknown`, `null`, `false` and `deferred` distinct: an unknown state is not idle, a null interaction count is not zero, and an unscanned detail is not proof of no blocker. An idle native Claude conversation without Watch is still usable when Send is offered: send the requested task and retain its automatically created Turn or Watch. A terminal-only Watch observes terminal activity, not exact native task completion.
An unresolved Claude terminal receives one additional fresh reader check during List, shared across unresolved panes in that scan, without terminal input. A separate read-only check can explain that the foreground window is in the background-session interface only when its owned registry and live process incarnation verify that role. This role does not mean the window cannot receive input. When its real `terminal_user_explicit` Send is offered, explain: 可以向此窗口发送任务。AKK 会输入文字并提交,但目前无法可靠确认后台任务的接受和完成状态;请在窗口中查看执行结果。 Without that physical action, the user can continue manually or start an ordinary foreground conversation and refresh List. Reopening the same background conversation does not add native acceptance or completion proof. This diagnostic never binds a background worker, grants actions, or authorizes daemon/claim-socket access.
To use that offered physical action, explicitly select its displayed `terminal_id` and call the existing `agent_knock_knock_send({terminal_id,request})`. AKK consumes the displayed private action internally; do not invent a public scope parameter or provide a private token. An ordinary managed Send must not silently switch to physical input after failure. Physical dispatch can prove text injection and Enter only as reported in its receipt; do not turn it into native acceptance, successful task completion or a promised completion callback. Check the actual window result, and never replay uncertain input through another route.
If identity remains unresolved and the more specific diagnostic is missing, invalid, stale or unavailable, keep the uncertainty and actual options: use the offered physical Send for that exact terminal with its stated proof limits, or inspect the original pane, continue manually, and retry ordinary startup/List refresh as appropriate. Missing native identity alone is not an input veto. Do not infer a background conversation or reader bug from missing evidence, promise that restart repairs discovery, substitute a background or same-directory agent, or replay an uncertain Send. A positive `managed.session_count` is a count of related current/historical Sessions, not current binding authority; null Session IDs and absent `binding_status` mean no authoritative current Session was selected.
Default CLI presentation prefers the verified backend entry for a one-to-one same-agent/project discovery pair without known identity conflicts. Use that returned conversation ID and its actions directly; do not search for or choose an alternative transport. Its title, state and actions belong to the selected backend. Presentation preference does not prove a terminal alias, copy terminal permissions, or redirect a previously selected terminal ID. Multiple candidates, conflicts and terminal attention/recovery records remain visible. Proven exact aliases still combine verified controls. Use `terminalDebug: true` (CLI `list --terminal-debug`) only when connection diagnostics are needed, not as a routine selection step. Unnamed, unstarted Codex candidates beside an established same-project conversation may be folded for display; `conversation_presentation.unstarted_candidates_omitted` reports their count and `diagnostic_query` expands them. This does not prove abandonment or an exact alias. If the requested new empty session is missing, use that query and its original exact ID; never substitute the established conversation. Sole or exactly associated new sessions remain visible, and a first task restores ordinary display.
For new Codex sends, AKK prefers the verified shared backend and retains an eligible terminal path when that backend is unavailable. For new Claude Code sends, AKK automatically prefers a managed terminal Turn when a unique controllable tmux/Herdr counterpart proves the same native session and process; without that terminal it uses the native inbox and returns a native Watch. The controller selects the conversation, not the transport or management mode. Busy/blocked state, identity conflict, ownership conflict or a Store error cannot authorize bypass to native delivery. Targeted reads can still use the exact backend; an idle terminal may use the advertised `/status` inspection to learn its identity, while working or blocked terminals are not interrupted. List itself sends no terminal input. Keep an uncertain dispatch receipt and inspect it instead of retrying through another connection.
For Desktop `delivery_path=native_thread_queue`, report `native_queue_accepted` as queued for the selected thread. Keep the returned Watch and inspect it for an exact `native_turn_id` and settlement. Never resend to obtain a turn ID. A user who later reopens the same thread in another client can change which client executes queued work. Live approvals, editor state, settings and cancellation require separately advertised capabilities.
Use the returned `watch_id` or `turn_id` for that task's follow-up. Existing Watches, Turns, send receipts and pending interactions keep their task and route, including native Claude Watches created before a terminal became available. After a question or approval callback, refresh that exact Status and copy the current interaction action; do not translate its IDs to another transport. Claude managed approvals follow the returned `turn_id`. Codex permission operations prefer the verified backend. Backend task recovery retains the original task identity and provider. Terminal binding/menu recovery, model and lifecycle operations retain their separately advertised capability; the caller does not pick a transport. The route-specific guidance below explains those capabilities and result boundaries, not an additional route-selection step.
## Recover a backend task
For direct Codex CLI and Desktop, use the exact returned `watch_id` or Send `turn_id`; never substitute a conversation ID or guess its latest task. The Host supplies the owning controller identity. Read `task_kind`, `management_state`, `observation_state`, and the advertised actions separately.
- `recover({watch_id})` rechecks the original thread/task and original submission receipt, updates persisted evidence and restarts eligible monitoring. It does not resend work, change the task anchor, extend a deadline, or resume explicitly stopped observation.
- `renew({watch_id,minutes})` verifies the original task and extends its observation deadline. It can resume an expired or unwatched task; a task already finished returns its actual outcome. Closed management cannot be reopened.
- `unwatch({watch_id})` stops observation and withdraws unsent notifications. It does not release a managed Send or cancel Codex work.
- `close({turn_id})` ends Send management and stops its observation. It also releases an unresolved Send reservation without claiming that the native send failed. A standalone Watch is not a managed Send: use Unwatch for it.
- `retry_callback({watch_id,notification_id})` retries one eligible recorded callback using its original notification ID, payload and controller target. Omit `notification_id` only when exactly one callback is eligible. Accepted, in-flight, uncertain and obsolete callbacks are not replayed; a pending interaction must be revalidated. This does not rerun the task or fix a later WeChat/channel failure.
Callbacks already in flight cannot be recalled by Close or Unwatch. `accepted` proves controller acceptance, not user-visible channel delivery. Terminal-specific `reconcile_binding`, `identify_foreground` and `repair_model_control` retain their original terminal semantics; backend Recover performs exact task reconciliation instead.
## Direct Codex CLI
A direct Codex CLI conversation uses an exact `codex-cli:v1:...` conversation ID. This route addresses the existing loaded backend thread and works without tmux or Herdr. It never starts a replacement CLI or treats saved history as a live owner. Embedded CLI sessions without a reachable shared backend continue to use the terminal route. Desktop uses its separate route below.
- Select by the returned title, working directory and native thread identity. Copy the advertised action; do not construct IDs, infer thread ownership from the newest same-directory history, or substitute another target. Unresolved physical terminal and direct thread rows can refer to the same work; select one conversation and send once.
- Send with `agent_knock_knock_send({conversation_id,request})`. AKK preserves current settings, submits once and returns `codex-cli-watch:...` for the accepted native task. Keep the receipt if acceptance is uncertain; refresh its Status instead of blindly sending again.
- Read the current thread with `agent_knock_knock_status({conversation_id})`. Watch an already-running exact task with `agent_knock_knock_watch({conversation_id})`; use `agent_knock_knock_status({watch_id})` for that task's result. A later idle state or different completed task is not evidence that the watched task succeeded. `agent_knock_knock_unwatch({watch_id})` only stops observation.
- When a callback reports a question or approval, refresh Status for that exact conversation or Watch and present the current request. Use `agent_knock_knock_respond_interaction` with that same `conversation_id` or `watch_id`, the current `interaction_id`, and the advertised typed `answers`. Blocking questions and async questions are supported; async delivery is `steer_current_turn` only. For authorized command/file approval, use `agent_knock_knock_approve` with the same target, exact `interaction_id`, and the advertised `approve_once` or `reject` decision. The backend revalidates the native request and task; no terminal tokens, raw keys or menu indexes are needed.
- Inspect permissions using `agent_knock_knock_permission_options({conversation_id})`, then apply the requested or authorized `read-only`, `default`, or `full-access` with `agent_knock_knock_set_permissions({conversation_id,mode})`. Full Access is a normal option with no additional confirmation. AKK waits for the effective thread setting before reporting success; global defaults stay unchanged and no task is created. Send permission-dependent work only after the setting is verified.
Use AKK's advertised actions and read the actual operation result after backend upgrades. A missing backend method fails that operation with an unsupported-capability diagnostic; it does not justify sending UI input to a guessed terminal. Existing terminal and Desktop capabilities retain their own limits. Model selection and native thread lifecycle operations are not added to this direct route.
## Direct Claude Code
Claude Code conversations use `claude-cli:v1:...` IDs for an already-running native CLI. Standard `claude` and configured wrappers such as `tclaude` share the same adapter; no wrapper is required. The default executable is `claude`, with the usual `~/.claude` home unless configured otherwise. Starting with AKK 0.15.0, an ordinary Send automatically uses a managed terminal Turn when an exact controllable tmux/Herdr counterpart exists; without that terminal, native inbox delivery remains available. Native live observations include macOS Claude Code `2.1.295` and `2.1.296` with peer protocol `1`; these are tested versions, not minimum versions. Python 3 is required on the AKK side. It needs no Claude plugin, hook, special launch arguments or replacement process. Use actual advertised capabilities and runtime evidence after upgrades, not a version number alone.
For native inbox delivery to Claude Code or tclaude, check `AKK_NATIVE_CLAUDE_SENDER_PERMISSION_CLASS` in the actual AKK/controller Host launch environment. It accepts `bypass` or `prompting` and declares the sender's permission class in the native `<cross-session-message from-mode="…">` envelope. AKK generates that envelope and escapes task text; send only the task in `request`, never construct a `from-mode` wrapper yourself. Managed terminal sends do not use that envelope. This declaration does not change Claude's permissions or approve a held message.
- Determine this class from the sender/controller's actual permission policy, explicitly configured by its operator, or verified evidence about the sender. Apply it only within an authorized setup task. The receiver's process flags and permission mode may explain a held message, but cannot establish the sender's class. Do not copy the receiver's mode or infer `bypass` from a headless controller. Leave the declaration unset if the sender's policy cannot be established.
- Configure the chosen value on the process that actually sends AKK requests, using its existing launch configuration. Setting it only in the target Claude process or another shell does not update a running Host. AKK itself never infers the class from the target command, target permissions, task text, or lack of an interactive UI; it uses the explicit sender configuration.
- Unset or empty means no declaration; an invalid value rejects a new Send before submission. The receipt reports `sender_permission_class` and `sender_permission_class_source` (`operator_configured` or `unspecified`). These describe the declaration, not acceptance. Keep held/refused/uncertain receipts and inspect the original Watch or terminal: changing the variable does not update or resend an old message, and it never authorizes automatic replay.
- Send to the selected verified idle conversation. With an exact eligible terminal, AKK creates the managed Turn and starts monitoring automatically; retain its `turn_id` for Status, supported approvals and question responses. No extra background flag or separate Watch is needed. When no exact terminal is available, native Send returns `claude-cli-watch:...` and monitors the exact input with the shared 720-minute hard deadline. Read the actual receipt; never claim managed approval support for a native Watch. Busy/blocked, held/refused or uncertain delivery must not be retried through another connection.
- Use `status({turn_id})` for a managed task and `status({watch_id})` for a native task. Conversation Status reads the latest native input and is not a replacement for the original task receipt. Native Watch Status reads its exact `native_input_id`, which is an input UUID, not a native turn ID. Public progress and tool-action summaries are bounded to 800 code points; List has no progress body. Native `agent_acceptance: proven` requires exact sender/message/input evidence, not merely a socket write.
- A successful `stop_hook_summary` does not prevent completion when the exact input's final message and durable completion record agree. Nonempty `hookErrors` or `preventedContinuation=true` still leave the task unproven; the summary alone is not proof of completion.
- Watch a manually started active task using the conversation action. Keep the returned Watch through task changes. Idle is not success; `exited` means the original process ended without proof of completion. A new process resuming the same history is not silently substituted.
- Use the advertised recovery and monitoring actions on the original Turn or Watch. For a native Watch, explicit Renew requires that same input still active; settled or exited tasks cannot renew. Accepted or uncertain callbacks are not replayed. Callback acceptance proves delivery to the controller, not to a downstream chat channel.
- Read the current `capabilities` and `available_actions` for cancellation, native inspection, model options and thread lifecycle controls. AKK exposes these existing terminal operations on the conversation only when one eligible tmux/Herdr counterpart matches its exact native session and process incarnation; it revalidates that counterpart at execution. Copy the advertised action and retain any model/lifecycle catalog result as required by the terminal guidance below. A missing counterpart or incompatible runtime contract/state does not grant input authority. An unlisted complete `x.y.z` version alone does not disable an otherwise eligible operation.
- Claude terminal model selection has regression profiles for `2.1.266` and `2.1.285`; other complete `x.y.z` versions may attempt the supported runtime contract through a profile bound to the actual version. Surface the unverified-profile explanation in `model_control.reason`. The live picker, choices and session-scope footer must match before a catalog can authorize selection; exact session/process, idle empty Composer, fresh catalog and postcondition checks still apply. Missing or malformed versions and unknown picker layouts remain unavailable. Thread `clear` uses the supported new-thread transition; Resume uses the exact UUID from a fresh resumable-thread catalog.
- An exact native Watch can notify the controller when its own task enters a registry waiting state; repeated observations of the same wait do not create duplicate notifications. These hints are notify-only (`requires_response=false`, `actionable=false`), and `pending_interaction_count: null` means the questions have not been exhaustively scanned. They do not supply response authority.
- AKK's current Claude native peer adapter does not implement approvals or question answers, and neither Claude route implements permission-mode switching. Existing terminal-managed approvals and supported questionnaires retain their exact Turn requirements. A current managed questionnaire can advertise `respond_interaction` on the associated conversation; refresh the action's original `turn_id` with Status in the owning controller conversation and use the resulting current question/answer IDs. Do not apply its identifiers to a native Watch. Unlisted complete Claude versions may use the same strict questionnaire parser, with fingerprints bound to the actual version. Only a fully recognized current question, choices and footer can authorize a single choice, a supported custom-text step or final-review decision; secret, multi-select, unknown or malformed dialogs remain manual. A generic profile allows runtime validation; it does not establish that every UI on that version has been tested. When no current response/approval action is advertised, report `manual_required` and return to the original Claude terminal. The sender permission declaration above does not add `set_permissions` or `permission_options`.
## Codex Desktop
Desktop rows in `conversations[]` have `surface="desktop"` and a full `desktop:v1:...` conversation ID. Their owner identity is separate from terminal selectors, managed Sessions, and managed Turns. The terminal-specific instructions below do not grant Desktop input authority.
- List defaults to `desktop_view: "sidebar"`: persisted expanded sidebar membership, including eligible pinned threads and expanded project members. This is not a live screen or scroll-viewport snapshot. Present all returned rows, including unconnected conversations, and distinguish them from rows that can receive tasks. Report `desktop_scan` limitations when the saved layout cannot be reconstructed; do not silently substitute the historical catalog.
- Find the intended row by title and project. Use `desktopSearch`, `desktopProject`, `desktopLimit`, and returned pagination cursor as `desktopCursor` within the same view. Use `desktop_view: "history"` explicitly to search the broader saved catalog for an older or hidden conversation. Do not assume the first page is complete or treat `live_count` as a count across unreturned pages. If several rows match, show their titles and project paths; do not invent IDs or ask for a deep link when List can discover the target.
- Sidebar and historical metadata can include unloaded conversations and entries whose original creator is unknown or was a CLI. Membership does not prove a current Desktop owner or task. Use the row's live state and advertised actions; keep an unavailable row visible rather than silently substituting another conversation. Existing historical conversations cannot be cold-loaded or resumed by this adapter. The separate Desktop Create tool only opens the new thread recorded by that creation operation. If an existing conversation has no verified live owner, tell the user to open that exact conversation in Desktop and refresh List before Send.
- Send a new task with `agent_knock_knock_send({conversation_id,request})`, using the exact listed Desktop ID and no `session_id`, `terminal_id`, or `turn_id`. The trusted Host supplies the stable message identity. AKK requires a freshly verified idle thread with no pending question, approval, or unconfirmed input, preserves its current settings, and attempts task submission once. It never sends a task through a replacement CLI, steers known active work, or retries uncertain input. Use the returned `watch_id` for follow-up; delivery uncertainty is not proof of acceptance or failure.
- Read the latest turn with `agent_knock_knock_status({conversation_id})`, including turns started directly in Desktop. If live activity is unknown, report a verified `persisted_history.latest_turn` as the latest saved turn. Return visible `final_text` to the caller together with any `final_text_notice`. Use `agent_knock_knock_status({watch_id})` for the exact watched task after the thread advances. A conversation becoming idle does not establish task success. Automatic notifications follow their recorded controller route.
- Observe an already-running Desktop task with `agent_knock_knock_watch({conversation_id})`. This requires one exact active native task; an idle or unknown conversation does not fall back to terminal-activity observation. Keep its `desktop-watch:...` ID. `agent_knock_knock_unwatch({watch_id})` stops observation without interrupting work.
- Desktop asynchronous questions appear in fresh Status as `interaction_state` with `kind: "async_question"`. A Watch notification prompts the controller to refresh Status, show the question and options, and wait for the user’s answer. Refresh again, then call `agent_knock_knock_respond_interaction` with that exact conversation or Watch and its advertised interaction/question/option IDs. Only the same active task can receive an answer (`steer_current_turn`); do not turn an expired question into a new task. Receipts are durable: inspect later Status `response_state` to recover them without resending. `sent` is an acknowledgement, while `confirmed` includes native answer evidence. Never replay an uncertain answer.
- Desktop blocking questions use the same `respond_interaction` tool with every advertised question answered in one response; omit `delivery_mode`. Desktop can automatically expire a nonblocking typed request, so refresh Status immediately before responding and never replay an expired answer. Command and file approvals use `approve` with the exact conversation or Watch, current `interaction_id`, and explicit user decision `approve_once` or `reject`. Refresh Status in the same controller conversation before acting. Native requests outside these supported forms remain manual. A notification does not authorize choosing an answer or granting permission.
- For an idle Desktop conversation, use `permission_options({conversation_id})` and `set_permissions({conversation_id,mode})` for `read-only`, `default`, or `full-access`. Full Access is an ordinary user-selectable preset without a second confirmation. This affects only the selected conversation; ordinary Send preserves its settings. Read `applied` and `effective`: a native acknowledgement alone is not proof that settings changed.
- `model_options({conversation_id})` reads the current model, reasoning effort, and Plan/default mode. Desktop does not expose a model catalog (`catalog_available=false`). Use `set_model({conversation_id,model,reasoning_effort,collaboration_mode?})` only with an explicitly requested model ID; optional `collaboration_mode` is `plan` or `default`. Omitting it preserves the existing mode. Effective settings do not prove a model is available to the account. An unconfirmed update must be inspected, not blindly replayed.
- Cancel with `cancel({watch_id})` for the exact watched task, or `cancel({conversation_id,expected_native_turn_id})` using the native task ID advertised by fresh Status. A late cancel must never interrupt a newer task. `unwatch` only stops observation. Arbitrary cold loading/resume remains unsupported; explicit creation uses the separate tool below.
Desktop uses private local IPC. Full controls have native-effect evidence on macOS builds `13536` (`26.1002.52244`) and `20398` (`26.1007.71326`); build `20156` (`26.1007.30912`) has creation, Send/Status/Watch, approval and answer evidence. Starting in AKK 0.14.14, all implemented Desktop operations, including creation and settings, can be attempted on other builds. An app update alone is not a write prohibition. `compatibility_policy: "attempt_native_contract"` describes this behavior; `capability_verification` and `*_contract_verified` describe tested evidence, not current action authority. Use fresh advertised actions and the actual operation result. Protocol, owner, task, revision and interaction checks remain mandatory; actual unsupported interfaces return errors. Never downgrade to raw UI input or relax identity checks. The native protocol has no atomic idle-and-send operation, so concurrent human input can make acceptance uncertain. Preserve the returned Watch and reconcile it instead of repeating the task. Callback acceptance remains separate from downstream chat delivery.
### Create a Desktop conversation
When `agent_knock_knock_desktop_create` is available and the user asks for a new Desktop conversation, use it instead of terminal `new_thread`. Available starting in AKK 0.14.5. It needs no existing conversation ID. Pass an exact existing `project` name or native ID, optional `cwd` and `title`, and optional first-task `request`. Omit `project` for a projectless conversation; omit `request` for an empty conversation. A multi-root project needs an explicit directory inside one of its roots. Without a project or directory AKK uses its private Desktop work directory. Creation opens the new conversation in the Desktop UI; it does not submit a hidden bootstrap task or change existing work.
Keep `operation_id`. If opening or uncertain, call the same tool with only that returned `operation_id`; do not issue a new creation or resend the task separately. AKK rejects unknown/foreign operations and preserves the original payload and callback route. `status: ready` proves Desktop ownership, not first-task acceptance: inspect `request_state`, `watch_id`, and `task_status` separately. No request means no task or completion Watch. A supplied request already receives exact automatic monitoring with the shared 720-minute default; retain its Watch and do not add another. An accepted callback proves controller acceptance, not delivery to the user's chat channel.
## Chat Routing
Use the `/akk` command for slash-command syntax. Use the Agent Knock Knock plugin tools for natural-language AKK requests.
Core slash-command forms:
- `/akk <task>`: send a new task only when exactly one send-ready coding-agent pane exists across all workspaces.
- `/akk <selector>: <message>`: resolve one exact eligible AKK session and create a new Turn for the message.
- `/akk list`: list coding-agent conversations, their managed-turn context, persisted expanded Desktop sidebar members, and durable Watches, coalescing only exact terminal/backend matches. Use the semantic tools above for Desktop history discovery and task operations.
- `/akk watch <exact-terminal-id>`: observe one exact user-selected terminal without submitting a task or creating a Session or Turn; prefer an exact task anchor and otherwise use a clearly labeled best-effort terminal-activity Watch.
- `/akk unwatch <watch-id>`: cancel only that observation; do not interrupt or otherwise change the TUI task.
- `/akk threads <exact-terminal-id>`: list verified native threads that may be resumed in one exact terminal.
- `/akk models <exact-terminal-id>`: inspect the exact native model and reasoning-effort catalog for one verified idle terminal.
- `/akk repair-model-control <exact-terminal-id>`: dismiss only a currently advertised exact stale profiled Codex 0.154.0/0.155.1 `/model` Composer surface or open native model picker and prove an empty Composer.
- `/akk set-model <exact-terminal-id> <advertised-model-id> <advertised-reasoning-effort>`: consume that displayed catalog once and change only the advertised semantic tuple.
- `/akk permissions <exact-terminal-id>`: inspect the idle Codex pane’s current permission mode and native built-in choices.
- `/akk set-permissions <exact-terminal-id> <advertised-mode-id>`: apply the user-selected mode from that immediately preceding catalog.
- `/akk new-thread <exact-terminal-id>` or `/akk clear-thread <exact-terminal-id>`: switch that idle terminal to a verified clean native context without creating a Turn.
- `/akk resume-thread <exact-terminal-id> [uuid|previous|number|@short-id]`: list candidates when the selection is omitted, or resume one exact snapshot-bound choice without creating a Turn. `previous` also accepts the human phrase `刚才那个`.
- `/akk status [turn-selector|terminal-watch-id]`: inspect one live terminal, exact managed Turn, or exact Terminal Watch.
- `/akk respond <turn-selector>: <answer>`: answer a coding-agent question inside a `waiting_for_openclaw` Turn.
- `/akk cancel <turn-selector>`: interrupt the exact Turn without closing its terminal pane.
The `terminal_user_explicit` physical-delivery rules below describe retained legacy routes/receipts and other explicitly advertised fallback paths. New ordinary Claude sends use managed terminal delivery; Store or ownership failure does not degrade them to unmanaged work.
For human-facing ordinary-send slash forms, a selector may be `codex`, `claude`, `only`, `latest`, or an `@short-ref` returned by `AKK list`. These selectors are only a resolution layer and fail closed when the target is missing or ambiguous. The v31 structured-tool contract never exposes a selector or opaque authority value: the model supplies semantic IDs only. Action contract v35 uses `terminal_user_explicit_composer_policy=per_agent` with `terminal_user_explicit_composer_policies`: Codex keeps `replace_current_composer_and_submit`, while Claude uses `require_empty_composer_and_submit`; the old Codex-named field is a v28 compatibility alias only. `send({session_id,request})` is strict `session_exact`; `send({terminal_id,request})` is either managed `terminal_follow_current` or user-priority `terminal_user_explicit`, exactly as advertised; the two target fields are mutually exclusive, and both may be omitted only when AKK must prove one unique send-ready pane. The following `terminal_user_explicit` rules apply to explicitly selected physical terminal actions and retained legacy receipts; ordinary Claude managed Sends never use failure as permission to switch to physical input. For those physical paths, Codex and Claude Code `terminal_user_explicit` depend on the exact live terminal/process, a scanned non-blocked approval state, and no proven input-owning questionnaire, editor, menu, history search, or read-only viewer. AKK Store, Turn, Session, transfer, transition, ledger, or ownership records do not establish that physical input is unsafe; cross-Store authority remains fenced. For Codex, ordinary main-Composer visibility, stability, exactness, parsed working activity and existing draft contents remain advisory. Claude instead requires an empty recognized main Composer, no existing stashed draft, a known native footer, and no running or unproven foreground turn; background shells alone do not block it. An unreviewed Codex frontend is the narrower exception: physical Send requires a recognized styled Composer before clearing and a fresh empty styled Composer before task text. Profiled Codex 0.154.0/0.155.1 exact collapsed async-question summaries leaves the main Composer sendable; an expanded, clipped, or ambiguous async editor and an active-writer resume viewer remain zero-input boundaries. The per-agent policies preserve the following clearing mechanics: Codex physical fallback sends `C-u` once; Claude Code refuses an existing stashed draft before input. On a freshly empty main Composer it uses one `C-s` to check for a hidden stash; restored content stops task submission and remains for the user. It writes no sentinel and deletes no draft. Each injects the request, waits through the paste window, and dispatches Enter exactly once. After text injection, Composer observation must never veto Enter. AKK tries managed delivery where its strict empty-Composer pre-input authority exists; after either agent's user-explicit text injection, that path follows the same no-Composer-veto Enter rule. A source-less Codex terminal with zero, one, or many pre-existing rollout roots freezes that full candidate set before input and binds only the unique rollout that later persists the exact request hash; a unique stale root is never assumed to be foreground. If managed preparation still fails before input, AKK sends once without a managed callback Turn, then best-effort attaches the prepared exact request-bound or clearly labeled terminal-activity Watch and releases stale management. Watch persistence failure is a warning and never revokes or retries a successful Send; an unsafe or uncertain native probe still stops before task text. Native inspection and native lifecycle input remain exact-empty-only. With runtime durability, an omitted target binds its `message_id` to the first selected physical terminal and existing or uncertain same-ID evidence rejects replay. If fresh durability is unavailable, user priority wins: AKK proceeds with a warning, and the degraded result must not be automatically retried. Once clear or request input may have occurred, an uncertain result must not be automatically retried. Read Send results as orthogonal facts: `terminal_input_dispatched`, `agent_acceptance`, `management_mode`, `observation_mode`, and `capabilities` distinguish physical dispatch from durable native acceptance and callback/interaction authority; do not infer one from another. If the result returns `observation_mode="terminal_watch"`, wait for that callback and retain `watch-status` as the recovery path. The only non-ordinary Send form is an exact `send({turn_id})` copied unchanged from a current `available_actions.retry_submission`; it accepts no request text or other target and requires explicit user confirmation. Native-thread actions use the full `terminal_id`, never an `@short-ref`. Other managed controls use `turn_id`; terminal-scoped approval uses `terminal_id` after explicit user confirmation. The trusted plugin/CLI derives terminal, binding, candidate, prompt, composer, handoff, and compare-and-swap fences privately. Never ask the user or model to copy draft text, a composer digest, a token, fingerprint, revision, binding ID/generation, or handoff-only live native UUID from an action; `native_thread_id` is the intentional semantic UUID for resume. For every side effect, AKK must revalidate the selected agent PID and provider-owned terminal identity and revalidate the relevant approval prompt; Composer revalidation remains action-specific; unreviewed Codex frontends require the styled-Composer checks above.
Claude physical-input preparation finishes before task text or Enter. A visible `› stashed` indicator refuses the attempt before any terminal input. When no stash is shown, AKK rechecks the empty main Composer and uses `C-s` once to restore any hidden stash. If content appears, it stops and leaves that content in the input box for the user; it does not re-stash or delete it. If the probe or final empty check is uncertain, it stops without task text or Enter and does not retry the key. This replaces the former sentinel transaction: no new marker is written and no editing keys delete a draft. There is no Composer observation or cleanup after task text or Enter. Ordinary managed Sends, Codex clearing and independent Watch monitoring are unchanged. This is refusal with manual recovery, not a guarantee of protecting drafts against simultaneous human input; avoid typing in the pane during an attempt. Screen capture and key delivery are not an atomic keyboard lock. A transport acknowledgement cannot prove that Claude processed `Ctrl+S`; ignored keys or cropped native indicators can leave stash occupancy unproven. AKK does not overwrite that unknown slot with a marker.
If List or Send reports a stashed draft, open that exact window and wait for the foreground turn to finish. Preserve any visible draft first. With the main input box empty, press `Ctrl+S` once to restore the stash, then save, send, or clear it yourself before refreshing List. AKK cannot identify hidden content just from the stash label. If restoration reveals `[AKK replacing current draft ...]`, it may be residue from an older failed AKK cleanup: remove only that marker after checking the text, preserve any other content, and do not press Enter on the marker. `Draft restored` is a transient restore notification; an accompanying `› stashed` still reports an occupied slot and remains a refusal condition. Do not repeatedly toggle `Ctrl+S` or retry an uncertain AKK attempt automatically.
The human-priority Codex path may proceed when the pane/process and complete open-rollout candidate inventory are exact even though no single foreground UUID can be selected, including a supported manual `/clear` whose new logical thread appears before its rollout materializes. The complete exact inventory domain binds the provider terminal, PID and process birth, workspace and canonical endpoint, and every open rollout's UUID, descriptor, device, inode, canonical path, and pre-submit byte offset. A `/clear` resume hint is advisory only, never routing or acceptance authority. Under the terminal lock, AKK isolates the predecessor, creates a separate zero-UUID provisional Session and Turn, sends the real task once, and binds only the single candidate rollout that durably accepts that exact request. A rollout-backed Codex row therefore advertises `terminal_follow_current` with `terminal_id`, not `session_exact`; a cached strict Session attempt rejects before task text and never downgrades itself. Only released predecessor Turn history from a strictly earlier binding epoch is excluded from current-send authority; unresolved current-epoch state still blocks. Use only the freshly listed semantic-ID action. Until promotion commits, strict `session_id` send, `respond`, managed `approve`, `cancel`, native lifecycle, callback delivery, and `native_inspect` remain unavailable. If delivery or acceptance is uncertain, do not retry automatically. Terminal-scoped manual Codex approval likewise exposes only `terminal_id`, requires explicit confirmation, leaves managed identity unchanged, never participates in auto-approval, and must not be retried blindly after an uncertain result.
For an exact-empty idle Codex pane whose native identity is ambiguous, List may advertise `identify_foreground` and `identify_and_send`. `agent_knock_knock_identify_foreground({terminal_id})` is explicit and Codex-only: it mutates no Store record but does send `/status` and Enter exactly once to the visible pane. Its 30-second proof is diagnostic, never reusable authority; do not feed its UUID or expiry into another tool. `agent_knock_knock_identify_and_send({terminal_id,request})` keeps one terminal lock across the probe and task and is the only actionable consumer of that observation. It still binds a durable Session/Turn only from unique exact request acceptance. A changed or uncertain probe sends no task and must not be retried automatically. Never invoke either action unless the current terminal row advertises it. List does not run `/status`. Targeted conversation Status may use the separate idle routing inspection above, not this diagnostic-only action. Ordinary Send must not be redirected through these explicit identification tools implicitly; Codex 0.158.0 and later stable semantic versions may attempt their separate closed `/status` transaction for exact paginated Watch binding when the actual UI and read contract can be proven.
The private approval fence remains prompt-scoped. It binds the adapter-isolated exact unredacted approval region plus terminal/process identity, decision keys and label, prompt kind, working directory, reason/detail, and request or policy evidence. The whole-screen digest and redacted excerpt are diagnostic only: output outside the approval region may continue scrolling without invalidating the same reviewed prompt. After explicit user confirmation, the plugin/CLI retains a private confirmation offer and recaptures the region under lock. Any change inside the exact region—including a command or otherwise identically redacted secret—rejects and sends zero approval keys. Never expose, persist as public action data, log, infer, or reconstruct the raw prompt evidence or its opaque fingerprint.
Coding-agent versions distinguish missing verification from known protocol incompatibility. A merely unverified complete Codex or Claude Code `x.y.z` version keeps otherwise eligible actions advertised; surface any supplied compatibility warning or diagnostic reason, then let runtime structure and postcondition checks decide success. Never suppress an action solely because its exact version lacks a regression-tested AKK profile. Known incompatible protocols disable their affected actions before input. Codex 0.157.0/0.157.1 create new durable TUI sessions with paginated history and may use a shared background server; AKK cannot yet bind that history to an exact managed task. Managed completion callbacks, native thread lifecycle actions, and automated native status dispatch remain unavailable; visible status cards can still be parsed. Explicit terminal Send and warning-bearing `terminal_activity` Watch remain available subject to native UI safety checks; that Watch reports best-effort activity notifications without proving exact task completion or granting question-response authority. `--no-daemon` does not restore legacy JSONL history for new sessions. Use only currently advertised mutation actions, and if input may already have occurred and the result is unproven, report the uncertainty and never retry automatically.
Codex 0.158.0 and later stable semantic versions may attempt an exact paginated task Watch instead of a legacy managed Session/Turn, including versions outside AKK's regression matrix. Before Send, AKK attempts a closed `/status` transaction in the available main Composer and validates the actual app-server read contract, Codex home, native thread, and task boundaries. A new version alone does not reject read-only observation. An existing exact Watch may continue across a compatible backend upgrade while retaining its original thread, turn, and request identity. When a Watch attaches, retain its `watch_id` for Status and callbacks; do not invent a `turn_id`. Read compatibility grants no native response authority: unreviewed frontend/backend pairs are notify-only, and backend drift withdraws existing executable question offers. Use fresh Status and its advertised capabilities before any response. This adapter does not establish managed session-only dispatch or native new/resume for paginated threads. Supported async responses offer only `steer_current_turn`, never `queue_next_turn`. A first Watch requested while a blocking modal already owns input cannot establish this binding and falls back to activity observation with manual question handling.
AKK discovers eligible panes across workspaces. When more than one target matches, choose one exact listed `terminal_id` for a structured tool or a listed selector for a human slash command; never guess based on a workspace name or path.
Natural-language forms:
- `AKK: <task>`: call `agent_knock_knock_send` with `request=<task>` and neither target ID. This succeeds only when exactly one send-ready pane exists. A selected Claude terminal uses the managed path and refuses busy, ownership or Store blockers. On eligible physical fallback paths, a scanned blocked approval or proven input-owning questionnaire, editor, menu, or read-only viewer vetoes physical Send; parsed working activity and an existing draft do not veto Codex Send. Claude requires an empty recognized main Composer, no existing stashed draft, a known native footer, and no running or unproven foreground turn; background shells alone do not block it. Unreviewed Codex frontends require the styled-Composer checks above; reviewed Codex physical Send paths do not require ordinary main-Composer visibility. Codex replaces the current Composer with `C-u`; Claude Code refuses an existing stashed draft before input. On a freshly empty main Composer it uses one `C-s` to check for a hidden stash; restored content stops task submission and remains for the user. It writes no sentinel and deletes no draft. Each injects the request and submits exactly once. Broken or stale AKK management activity records do not veto that independently verified live terminal/process.
- `AKK Codex: <task>`: list first and identify one exact eligible Codex conversation. For a direct CLI or Desktop row, copy its advertised Send with `conversation_id`; for a terminal row use its `terminal_id`. Send `request=<task>` once through that route. Do not count duplicate representations of the same proven thread as separate tasks.
- `AKK Claude: <task>`: list first, require one exact eligible Claude row, then call `agent_knock_knock_send` with that row's `terminal_id` and `request=<task>`.
- Requests to list AKK or local coding-agent work: call `agent_knock_knock_list`.
- Requests to observe an exact Codex or Claude Code terminal: normally call `agent_knock_knock_list` and copy that row's advertised `watch` action, then pass its complete `terminal_id`. If the user explicitly selected a complete exact terminal ID, missing `available_actions.watch` is not a veto: Watch may still be called with that ID. Never guess, shorten, or substitute a selector. AKK prefers an exact task anchor and otherwise records warnings and observes the terminal/process activity epoch.
- Requests to inspect an existing Terminal Watch: call `agent_knock_knock_status` with its authoritative `watch_id`. Requests to stop observing it: call `agent_knock_knock_unwatch` with that same `watch_id`. Never substitute a Session, Turn, terminal selector, or short reference.
- Requests to continue in the current terminal context after the human may have run `/clear`, `/new`, `/resume`, or an equivalent native operation: first call `agent_knock_knock_list`, then use only that exact terminal row's advertised `send({terminal_id,request})`; do not substitute the stale `session_id`.
- Requests to recover an AKK submission reported as uncertain: refresh `agent_knock_knock_list`. Only if the current exact Turn advertises `retry_submission`, explain that AKK will revalidate the immutable original request and may either press one Enter for the exact existing draft or retransmit that original text once after structured no-Enter proof and a positively empty composer. Require explicit user confirmation, then call the prefilled `agent_knock_knock_send({turn_id})` unchanged. Never add `request`, terminal/Session IDs, timeout fields, or callback route data, and never retry it automatically.
- Requests for the coding agent's native Codex status card or Claude Status panel: first call `agent_knock_knock_list`, then call `agent_knock_knock_native_inspect({terminal_id,inspection:"status"})` only when the exact terminal row advertises it; do not substitute AKK Turn status or ordinary send.
- Explicit requests to diagnose an ambiguous current Codex foreground: call `agent_knock_knock_identify_foreground({terminal_id})` only from that row's current action. Explain that it types one `/status` command, changes no Store state, and returns a non-authorizing 30-second observation. Never use the result as authority for a later mutation.
- Explicit requests to identify an ambiguous Codex foreground and send one task atomically: use the row's exact `agent_knock_knock_identify_and_send({terminal_id,request})` action. Do not synthesize this path for an ordinary Send or split it into identify-then-send calls.
- Requests to list resumable native threads for an exact terminal: call `agent_knock_knock_list_resumable_threads` with the terminal row's prefilled `terminal_id`.
- Explicit requests to start a new thread or clear context: call `agent_knock_knock_new_thread({terminal_id})` only from an advertised `new_thread` action.
- Explicit requests for low-level recovery of a listed binding conflict: after explicit user confirmation, call only the advertised `agent_knock_knock_reconcile_binding({terminal_id,conflicting_session_id})`. AKK derives its revision and binding fences privately, detaches the stale/conflicting binding without adopting the live thread, and requires a fresh list afterward. Do not use it in place of an advertised follow-current send.
- Automatic Store authority recovery keeps the existing shared runtime location and never deletes temporary Store directories. It requires the source Store's explicit `AKK_EPHEMERAL_STORE=1` registration, a private owned non-symlink `akk-*` path inside the system temporary directory, every registered owner proven dead by exact process incarnation, settled work, and fresh matching native-session/terminal identity with idle non-blocked status. A temporary pathname, timeout or absent PID alone never grants takeover. Persistent Stores use the explicit transfer action below. When a newer writer records older legacy authority, incomplete legacy owner coverage remains recorded; later writes cannot turn it into an automatic takeover candidate. Conflicting or unfinished cross-Store authority also blocks physical fallback Send; do not use a native backend or physical token to bypass it.
- Explicit requests to move a settled native thread's authority from another AKK Store to this Host: refresh List and use only `available_actions.transfer_store_authority`, including when it appears on a native Claude conversation row. Its tool is `agent_knock_knock_reconcile_binding({operation:"transfer_store_authority",terminal_id})`; keep the advertised physical `terminal_id` and obtain explicit user confirmation for the transfer. If `missing_required` includes `maintenance_acknowledgement`, the legacy record cannot prove the previous Host/writer has stopped: first require the user to stop every Host and old writer using the source Store and explicitly confirm that maintenance condition, then pass `maintenance_acknowledgement:true`. Never prefill or infer this from an idle terminal, a completed task, a resolved ledger, or an elapsed timeout. Visible live or unverifiable owners and unresolved work remain blocked. The transfer sends no coding-agent input and creates no Turn; refresh List afterward and use the same native conversation's newly advertised Send. Never delete ledger or Store files, invent a conflicting Session, pass private tokens/Store paths, or use binding-detach as an authority-transfer substitute.
- Explicit requests to resume prior native context: first call `agent_knock_knock_list_resumable_threads`; then call `agent_knock_knock_resume_thread({terminal_id,native_thread_id})` for one `resumable=true` candidate using its complete UUID. For “previous” / “刚才那个”, proceed only when the fresh result advertises `previous.available_actions.resume_thread`; use that exact semantic-ID action and never substitute the newest row. Human-facing numbers and short IDs are resolved privately and are never structured tool arguments.
- Requests to inspect current output or ask what a task is doing: call `agent_knock_knock_status`.
- A later ordinary request: refresh `agent_knock_knock_list` and use only the selected terminal row's advertised send. Use `send({session_id,request})` for `session_exact` or `send({terminal_id,request})` for `terminal_follow_current`; never substitute a retained Session or Turn identity.
- Requests to continue the current terminal context are ordinary terminal-scoped sends, not lifecycle actions. Use only a freshly advertised action carrying the exact `terminal_id` when a human-driven switch is present.
- An answer to a coding-agent question in a `waiting_for_openclaw` Turn: call `agent_knock_knock_respond` with its authoritative `turn_id` and `request=<answer>`.
- An answer to a native coding-agent interaction is a different flow: in the same controller conversation, call `agent_knock_knock_status` with exactly one authoritative subject (`{turn_id}` for a managed Turn or `{watch_id}` for a response-capable exact Watch), show the current pending `interaction_state` to the user, and require their explicit choice or text. Only when `capabilities.respond=true`, call `agent_knock_knock_respond_interaction` with that projection's same exact subject id, `interaction_id`, and typed `answers` using its opaque `question_id` and `option_id` values. For `kind="async_question"`, the coding task remains `working`; optionally pass a current advertised `delivery_mode` (default: `steer_current_turn`): `steer_current_turn` answers the running turn and `queue_next_turn` queues the answer for its next turn. For blocking `kind="questionnaire"`, omit `delivery_mode`. One call answers only the current step; call Status again before each later question or final confirmation. Never guess ids, translate a label into raw keys or menu indexes, answer a `manual_required` or secret-input state, or retry an uncertain response blindly.
- Requests to stop current work: call `agent_knock_knock_cancel`.
## Sessions and Turns
For terminal resources, AKK's identity hierarchy is terminal → native Codex or Claude Code session → AKK session → Turns. Direct Codex CLI uses its `conversation_id` and independent `codex-cli-watch:...` records; Desktop uses `conversation_id` and `desktop-watch:...`, as described above. `session_id` is the strict terminal ordinary-send target for one exact native context. `terminal_id` is the deliberately different follow-current target that lets the user hand the pane's currently verified context back to AKK after a safe human-driven switch. Each accepted managed Send creates a distinct `turn_id` without clearing the native agent context; Codex paginated physical Send instead returns an independent exact-task or terminal-activity Watch when observation can be attached. A `turn_id` is used for history, callbacks, respond, status, approval, cancellation, renewal, callback retry, close, and the explicitly advertised submission-retry form of Send.
Use `agent_knock_knock_send` with `request` and neither `session_id` nor `terminal_id` only when the target is unspecified. AKK must resolve exactly one eligible Codex or Claude Code pane across all workspaces and use its currently advertised Send path. Managed delivery attaches or discovers its AKK session and verifies idle before input; Codex paginated physical Send does not require a managed Session and follows its terminal input-safety checks. If no eligible pane exists, report AKK's setup guidance; do not substitute another execution path.
On first attach, the target terminal must be explicitly named by the user; never guess which already-running pane should receive the task.
For ordinary send or an in-flight answer:
1. Reuse an AKK session only when the user's reference uniquely identifies its verified native session and terminal incarnation.
2. If no ID is supplied and more than one eligible pane may exist, call `agent_knock_knock_list`.
3. Treat `conversations[]` as the primary resource list; older raw CLI output may expose `terminals[]` instead. For a terminal-backed row, its managed context exposes `session_id`; `managed.current_turn` is the current AKK owner. Query `watches` for retained monitoring and managed Turn history, including unavailable-pane recovery.
4. Read the selected resource's `available_actions`. In the compact Host projection its keys are the exact current action names and each value is `true`; `action_inputs`, when present, carries only dynamic semantic arguments, `missing_required`, and scope. For every mutation, use only an advertised action, start with those semantic inputs, supply every `missing_required` field, and follow this skill's action rules. User-selected Watch is the exception: explicit user intent plus one complete exact `terminal_id` is sufficient even when `available_actions.watch` is absent. The only additional mutation sources are a terminal row's `handoff_decision.choices.take_over_current.action` and an exact `blocking_turns[].recovery_action`: use either only after explicit user confirmation and refresh the list immediately afterward.
5. If an existing managed Session advertises send with `session_id`, call `agent_knock_knock_send({session_id,request})`; it creates a new Turn strictly in that Session's native context and may require exact empty before input. For an ordinary selected conversation, call `agent_knock_knock_send({conversation_id,request})`; terminal-scoped rows also accept legacy `terminal_id`. The following physical-input rules apply to an explicitly selected physical terminal action and retained legacy routes/receipts; ordinary Claude managed sends never silently switch to physical input after failure. `terminal_follow_current` may adopt a safe human-driven handoff or send once within an exact, complete Codex rollout-candidate inventory before binding the uniquely accepting native thread. `terminal_user_explicit` instead preserves the user's Send when internal AKK state is broken: Codex replaces the current Composer with `C-u`; Claude Code refuses an existing stashed draft before input. On a freshly empty main Composer it uses one `C-s` to check for a hidden stash; restored content stops task submission and remains for the user. It writes no sentinel and deletes no draft. Each injects the new request and submits exactly once without a post-text Composer veto. For source-less Codex sends, zero exact acceptors remains pending for monitor recovery, one promotes the provisional Session/Turn, and multiple acceptors or identity drift becomes uncertain without replay. Within an already selected physical-input operation, eligible managed delivery may be attempted; a proven zero-input failure can then use that operation's established unmanaged fallback with no managed callback Turn. This does not authorize changing an ordinary Claude managed Send into a physical operation. AKK prepares the strongest safe Watch before dispatch and best-effort attaches it after Enter; Watch persistence failure never changes the successful Send. Once clear or request input may have occurred, an uncertain result must not be retried automatically. Wait for an attached Watch callback or use its status as recovery. The status-card-only first-task path remains the zero-rollout special case. `send({turn_id})` is never an ordinary target: use it only for a fresh `retry_submission` action after explicit confirmation, with no other field. Never construct or pass an opaque fence or composer authority. Use `respond` with its `turn_id` only when that Turn is explicitly `waiting_for_openclaw`; the answer stays in the same Turn. Do not add timeout fields for ordinary use; `timeoutSeconds` is unsupported.
6. If multiple terminals match, show their `short_ref`, agent, provider, and terminal target, then ask the user to choose. If a human switch has an unresolved Turn, ambiguous ownership, or unverifiable identity and no follow-current send is advertised, report that blocker and ask the user which context to resolve; never guess, supersede active work, or bypass the fence.
An idle pane is at a verified ready prompt, with no current work or unresolved permission request. A previously completed managed turn alone is not proof that the pane is still idle.
Do not treat ordinary Send's whole-draft Composer replacement as a native conversation clear, new-session, fork, branch, side thread, status probe, or resume. Do not send `/clear`, `/new`, `/resume`, `/status`, Codex `/fork`, `/side`, `/btw`, Claude `/branch`, or any other first-line native slash command as ordinary task or answer text. Dedicated native lifecycle and inspection tools own their closed commands, capability checks, serialization, identity verification, and binding fences; express other requests in natural language or leave unsupported native commands to a human in the terminal UI. Each successful lifecycle transition creates no Turn, and native inspection creates no Session or Turn.
## Terminal Watch
Terminal Watch follows the exact terminal selected by the user. Codex paginated exact Watch creation uses a closed `/status` transaction in an available main Composer to bind its foreground paginated task; subsequent observation is read-only. Answering a supported native interaction later is a separate explicit, owner-bound mutation. The normal sequence is user selects a Codex or Claude Code terminal → fresh `agent_knock_knock_list` or `/akk list` → copy its complete `terminal_id` and, when present, its advertised `watch` action → retain the returned `watch_id` for status or unwatch. Advertisement is discovery help, not Watch authorization. If the user explicitly supplies one complete exact terminal ID, call `agent_knock_knock_watch({terminal_id})` even when that row does not advertise Watch. Never infer a terminal or use a selector/short ID.
Managed ownership is not a veto. Prefer an existing managed Turn monitor when exact Turn attribution is wanted, but an explicit Watch may coexist because subsequent observation sends no input and does not adopt, replace, close, reserve, block, interrupt, approve, or otherwise mutate that Turn, Session, terminal, or task. Codex paginated exact Watch creation separately types the closed `/status` transaction described above. A successful `terminal_user_explicit` unmanaged fallback may separately return an automatic exact request-bound or terminal-activity Watch after AKK sends; retain that `watch_id` and use Status for recovery. Once exact request acceptance, terminal identity, owner, and one current supported native interaction are established, that Watch may emit an idempotent `interaction_required` callback. The callback itself is notification only; call `agent_knock_knock_status({watch_id})` in the owning controller conversation to obtain the single-use private response offer, and respond only when its projection says `capabilities.respond=true`. When exact response authority cannot be proven, AKK emits `interaction_manual_required` instead; that state and every terminal-activity Watch remain notify-only with `capabilities.interaction_respond=false`, so the human must answer in the live TUI.
At creation, AKK first tries to build a privacy-safe exact provider task anchor. A Codex paginated read-contract Watch binds the exact foreground thread and native task; older supported Codex versions bind rollout identity and request/turn byte boundaries. Claude binds transcript identity, root prompt, and current-turn byte boundaries. Success returns `watch_mode="exact_task"`, `confidence="exact"`. Legacy anchors invalidate on process, endpoint, native-thread, file identity, truncation/replacement, boundary, successor-task, or fingerprint drift. A Codex paginated Watch retains the original accepted native turn even when an unrelated later task starts; it never follows that later task or loses the original completion merely because a successor exists.
Missing or mismatched agent-version evidence is always a warning and does not weaken an otherwise usable exact task anchor. If no unique usable anchor can be established because artifact, native-task, or boundary evidence is unavailable or incompatible, do not reject. AKK records those diagnostics in `warnings` and creates `watch_mode="terminal_activity"`, `confidence="best_effort"`. Binding metadata, managed ownership, and missing action advertisement likewise remain non-veto warnings. This fallback follows only the selected terminal/process activity epoch. It must first observe `working` or `awaiting_approval`, then stable `idle` across consecutive supervision sweeps. Starting at `idle` or `unknown` never settles immediately; later activity must be observed first. For automatic fallback after Send, the Watch is request-correlated and starts with no observed activity: it must see activity after that Send, then two idle observations. Pre-Send activity cannot complete it. Replaying the same `message_id` cannot resend the task or create duplicate notifications.
Treat a terminal-activity completion-shaped callback exactly as labeled: it means the observed terminal activity became idle. It is not proof that one exact task completed or succeeded, and it carries no exact-task completion text. State that limitation plainly to the user. Do not silently upgrade it to managed or exact-task attribution.
Hard creation failure includes an absent exact terminal, inability to identify its endpoint/process, absence of both a durable exact-task anchor and a read-only screen-status activity path, inability to create/write the durable Watch Store, or uncertain native probe input. Safe read-contract failures may fall back to activity observation only after revalidating the physical endpoint, PID, process incarnation, working directory, and screen-status path; never bypass an unsafe input surface or retry uncertain probe input. Existing identical active observation may return its current `watch_id` instead of failing as a duplicate.
Approval attention is notification-only for every Watch: never call an approval tool for a `watch_id`, send approval keys, or apply `autoApprove`. Native-interaction attention is different. An automatic exact request-bound Watch created by `terminal_user_explicit` unmanaged fallback can, after exact request acceptance and attribution, emit `interaction_required`; call Status with its exact `watch_id`, show the projected question to the user, and use `respond_interaction({watch_id,...})` only when that fresh owner-bound projection advertises `capabilities.respond=true`. A terminal-activity Watch or `interaction_manual_required` callback remains notify-only: tell the user to inspect and answer in the live TUI, and send no interaction input. Each new exact attention fingerprint is notified once while the Watch remains active. Terminal outcomes settle once. The durable outbox uses deterministic notification IDs/idempotency and leased retry, so startup and periodic supervision can safely recover callback delivery after AKK, OpenClaw, or Gateway restart.
DSH restart recovery, when the Host provides persistent Session recovery and flushing, retains callback ownership for the original profile, Store, and Session generation while rotating the private IPC channel. A delivered notification means durable inbox admission, not that the model consumed it. Historical process-private DSH routes require explicit operator adoption of the exact Watch and original Host Profile; never rewrite Store routes or infer ownership from a decoded session ID. A successful Host restart or reconciliation sweep alone does not prove Watch settlement or callback delivery. Check those separately. Unknown activity must remain pending, and terminal-activity idle remains best-effort evidence.
The current integrations register the complete capability-handshake-verified semantic AKK tool catalog and list action-contract v35. Updated OpenClaw, Pi, and DeepSeek Harness Lists default to compact projection v5 (explicit v4 remains available) and point here for the static contract; the CLI keeps the complete operator/debug action contract. Every structured model action carries semantic IDs only; opaque fences, Composer digests, and draft text are derived or retained privately. Watch uses `agent_knock_knock_watch({terminal_id})`, `agent_knock_knock_status({watch_id})`, and `agent_knock_knock_unwatch({watch_id})`; its internal CLI boundary is `watch-terminal`, `watch-status`, `unwatch-terminal`, and `reconcile-watches`.
For Codex permission changes, first call `agent_knock_knock_permission_options({terminal_id})` from the current row’s advertised action. This sends closed `/status` and `/permissions` inspection input but leaves permissions unchanged; the terminal must be idle, its Composer empty, and its physical and native thread identities verifiable. Use `current`, `scope`, and the returned choice descriptions to select the requested or authorized mode. Then call `agent_knock_knock_set_permissions({terminal_id,mode})` using its exact returned semantic ID in the same controller conversation. Full Access is an ordinary option and needs no additional user confirmation. AKK automatically handles its exact native confirmation inside this permission transaction; do not pause to ask the user to confirm Full Access or call generic `approve` for that dialog. Ordinary Send does not change permissions. Codex 0.160 may report `current="workspace_granular"`; this is a current-only native default, not a selectable mode. Select only an ID actually returned in `choices`. Only currently displayed built-in modes are supported: do not invent `read_only` when the picker omits it, supply a named/custom profile, or pass commands, labels, menu indexes, keys, tokens, or scope overrides. Changes affect the current session/thread, may be retained on Resume, and leave global defaults unchanged. Send the intended task only after `outcome="changed"` or `"already_effective"` with matching `effective.mode`; `"uncertain"` means stop and do not retry automatically. Refresh the catalog after any change or consumed attempt.
For native model control, first call `agent_knock_knock_model_options({terminal_id})` only from the current terminal row's advertised action. This is explicit current-snapshot authority for one exact physical pane/process: Profiled Codex 0.154.0/0.155.1 may use either one exact current native Session or a verified-zero-rollout pane, where `identify_foreground` is diagnostic rather than a prerequisite; Claude Code still requires one exact current native Session. The pane must have no active Turn, approval, questionnaire/editor, or read-only viewer. It normally requires an idle empty Composer; when List advertises `model_options` for one exact stable profiled Codex 0.154.0/0.155.1 `/model` residual, AKK may continue only that residual into read-only catalog discovery. Show the returned `scope`, current selection, and semantic model/effort catalog to the user. Then call `agent_knock_knock_set_model({terminal_id,model,reasoning_effort})` with an exact required tuple from that same result in the same controller conversation. Codex scope is always `current_and_new_sessions`: a successful selection persists the model and an ordinary effort (including `max`) for future sessions, but `ultra` is current-session-only and Codex chooses a non-Ultra future fallback. Always read `effective` and `new_session_defaults` separately. Claude Code scope is always `current_session`. There is no caller-selectable scope. Never pass a display label, menu index, slash command, raw key, token, or fingerprint. A stale or consumed catalog must be refreshed, and `outcome="uncertain"` must never be retried automatically.
If the current List also advertises `repair_model_control`, it is the explicit
cleanup-only alternative: call
`agent_knock_knock_repair_model_control({terminal_id})` or the matching
`/akk repair-model-control <exact-terminal-id>` only when the user wants the
residual cleared instead of continuing discovery. For an already-open exact
native picker this is the only model-control action List may advertise: it may
dismiss the picker but has no Enter authority. It accepts no raw text or keys,
never presses Enter, and must prove an empty Composer. Refresh List after
success; never retry an uncertain repair automatically.
For native status inspection:
1. Use only a current `available_actions.native_inspect({terminal_id,inspection:"status"})` entry. Those semantic arguments are complete; never add a command or authority field.
2. Regression-tested profiles are Codex 0.146.0/0.146.1/0.147.0/0.148.0/0.149.1/0.150.1/0.151.0/0.153.0/0.153.4/0.154.0/0.155.1/0.158.0/0.159.0/0.159.2/0.159.3/0.160.0/0.162.1/0.164.0/0.165.0/0.166.0/0.167.0/0.169.0/0.170.0/0.171.0 and Claude Code 2.1.218/2.1.226/2.1.237/2.1.251/2.1.259/2.1.263/2.1.266/2.1.267/2.1.285 `inspection="status"`. Other complete `x.y.z` versions remain callable through the generic runtime profile and add a compatibility warning; actual incompatible UI or schema evidence fails at runtime and is not automatically retried. Claude success includes parsing and safely dismissing the newly opened Status panel. The inspection tool does not accept `/status` text or any arbitrary command string. `/usage`, `/cost`, `/stats`, `/usage-credits`, raw `/model`, `/compact`, and arbitrary slash commands remain unavailable; model changes use only the typed model-control tools above. Never automate bare Codex `/usage`: it opens an interactive menu whose later Enter can select an account-side usage-limit reset.
3. Treat this as terminal input even though the native command is read-only. AKK privately derives a fresh binding fence and requires an idle empty composer, exact PID/process/pane/cwd/version identity, and no conflicting Turn, transition, dispatch, approval, or owner.
4. Codex `/status` requires an exact viewport of at least 80 columns so the full Session UUID can be proven. That pre-UUID gate applies to native inspection, lifecycle, and strict Session operations that must know the UUID before terminal input. Legacy terminal-scoped ordinary tasks may send once and bind from exact native acceptance afterward without running `/status` or failing merely because the pane is narrow. Codex paginated read-contract candidates attempt their separate closed `/status` binding before physical Send. If an exact callback Watch cannot be prepared safely, AKK may prepare terminal-activity observation; report the receipt's actual callback mode and limitation.
5. The result is valid only when AKK proves one fresh bounded native status result and the pane returns to idle. On an uncertain or unproven submission, do not retry, send Enter, clear the composer, or bypass AKK with raw terminal input.
6. Native inspection creates no AKK Session, Turn, receipt, monitor, callback, or response round.
For native-thread lifecycle discovery or mutation:
1. Start from the exact terminal row's currently advertised `list_resumable_threads({terminal_id})` or `new_thread({terminal_id})` action. Listing is read-only and creates no Turn.
2. Before `new_thread` or `resume_thread`, the terminal must be verified idle and have no active or unresolved Turn. The plugin/CLI derives and revalidates the current binding fence internally; the model never supplies one.
3. For resume, list candidates first and invoke only `resume_thread({terminal_id,native_thread_id})` for one row with `resumable=true`, using its complete UUID. Never select by title, preview, recency, or partial UUID. Human slash-command numbers and collision-safe short IDs refer only to the current private snapshot and are resolved inside AKK; they are never structured tool arguments. If the user says “previous” or “刚才那个”, proceed only when AKK advertises one exact previous candidate derived from the latest committed transition; if absent, explain that AKK cannot prove it and ask the user to list/select instead.
4. Treat mutation success as a Session/native-context transition, not as task delivery. It creates or activates an AKK `session_id`, advances the terminal binding generation, and creates no `turn_id`. The next ordinary send creates the first Turn in that context.
5. If the agent/version is unsupported, a candidate is ambiguous or active elsewhere, the private fence is stale, or post-transition identity cannot be verified, fail closed and report the error. Do not fall back to raw terminal commands.
Useful examples:
```text
/akk review the current branch and propose a small fix
/akk codex: inspect the repository and summarize it
/akk @a1b2c3d4: run the focused tests
/akk list
/akk threads terminal:v2:tmux:codex:akk-work:0.0:1234
/akk models terminal:v2:tmux:codex:akk-work:0.0:1234
/akk set-model terminal:v2:tmux:codex:akk-work:0.0:1234 gpt-6-astra ultra
/akk new-thread terminal:v2:tmux:codex:akk-work:0.0:1234
/akk resume-thread terminal:v2:tmux:codex:akk-work:0.0:1234 previous
/akk resume-thread terminal:v2:tmux:codex:akk-work:0.0:1234 2
/akk resume-thread terminal:v2:tmux:codex:akk-work:0.0:1234 11111111-1111-4111-8111-111111111111
/akk status only
/akk respond @a1b2c3d4: use the existing JSON format
/akk cancel only
```
## Terminal Communication Contract
All controller-to-agent task delivery must go through Agent Knock Knock plugin tools. Do not use Host-internal session tools, raw terminal-provider commands, shell commands, or another messaging path to bypass AKK's terminal checks.
AKK:
1. Resolves the authoritative AKK session to its selected Codex or Claude Code native session, process, and terminal pane.
2. Revalidates the expected agent PID and provider-owned terminal identity, confirms that the process and pane working directories match, and verifies the idle prompt.
3. Types only the user-facing task into the shared terminal.
4. Creates a unique managed `turn_id` bound to the AKK `session_id`, terminal incarnation, and message.
5. Monitors reliable local evidence and sends callbacks to the originating controller session.
The coding agent does not run an AKK callback command and does not require an AKK-specific hook or plugin.
After an asynchronous send operation is accepted, end the controller turn. Wait for AKK's callback unless the user explicitly requests status.
Accepted managed Claude terminal Turns retain exact observation until a verified result or explicit release. Their configured inactivity and hard-lifetime thresholds produce a durable uncertainty notice instead of silently ending monitoring; other executors and native Watch deadlines are unchanged. An advisory is not completion and does not replace the eventual final callback. Do not resend the task, add a duplicate Watch, or promise human-visible delivery. Startup may resume a legacy timeout stall only through its original verified binding, dispatch generation and callback route; it never resends task text. Managed outboxes retry transient failures on their existing persisted route; an unknown outcome can be replayed only to a trusted, durably deduplicating receiver, never merely because a model supplied a flag. Explicit Close and supersession remain fences. See docs/managed-task-result-delivery.md.
## Status
For managed terminal entries, `agent_knock_knock_status` captures AKK Turn state plus a bounded terminal screen and returns `terminal_screen`. With `watch_id`, it returns the exact durable Terminal Watch record, including `watch_mode`, `confidence`, and any warnings. It must not imply that an exact task completed when a `terminal_activity` Watch only observed stable idle, or that Watch sent/adopted the task. Neither form actively executes the coding agent's native `/status`. Use `agent_knock_knock_native_inspect` only for a terminal row's advertised, version-scoped native status action. Do not inspect the pane with raw provider or shell commands unless the relevant AKK inspection is unavailable or fails.
For an exact managed Turn or a response-capable exact Watch, Status may return a native `interaction_state`. The managed monitor or exact Watch proactively sends an `interaction_required` callback for each supported actionable step, but that callback is notification only: it does not create response authority. In the owning controller conversation, call Status with the callback's exact `turn_id` or `watch_id`, treat the returned state as a single-use current-step projection rather than ordinary response text, and display it to the user. The private response offer exists only in the same controller conversation that displayed that Status result. Require `state="pending"` and `capabilities.respond=true`, review the projected question with the user, and pass exactly the same subject id plus only its semantic ids and typed answer to `agent_knock_knock_respond_interaction`. A blocking `questionnaire` may pause the task and never advertises or accepts `delivery_mode`. A Codex `async_question` coexists with a still-`working` task, advertises `delivery_modes`, and defaults to advertised `steer_current_turn`; explicitly select advertised `queue_next_turn` to queue the response. For an async-question custom answer, select its advertised native Other option and refresh Status for a separate `free_text` step; this does not use blocking Notes. For a blocking Codex questionnaire custom answer, choose the guarded `Type something.` option advertised beside the exact client-generated `None of the above` row; AKK derives this semantic option when the client rendered only native Other. AKK moves to that native Other row, opens its Notes editor, and the next fresh interaction accepts `free_text`; choosing `None of the above` itself still submits it directly without Notes. Codex delivers custom text as `user_note: ...` alongside the native Other label, not as a Claude-style bare value. One call answers one step; wait for the next callback or refresh Status after success because the next question, custom-text editor, or final confirmation has a new `interaction_id`. If only the displayed `expires_at` has elapsed while its session-bound private offer remains live, Respond performs an exact locked terminal recapture before input; changed, missing, `manual_required`, secret, multi-select, uncertain, terminal-activity, or subject-mismatched interactions still fail closed. Codex 0.154.0 and 0.155.1 use version-bound native TUI evidence for async questions; do not assume either release contains the notification or stable-question-identity wrappers added only on post-0.155.1 main. Never send raw keys, shortcut chords, or menu indexes, and never retry blindly.
## Cancellation and Recovery
`agent_knock_knock_cancel` uses the adapter's interrupt action—Control-C for Codex or Escape for Claude Code—and leaves the terminal pane open.
Use `agent_knock_knock_renew` only when AKK marked the same live terminal Turn `stalled`, the process and Turn remain in the same pane, and the user wants monitoring to continue without terminal input. The contextual slash form is `/akk renew @a1b2c3d4 30`.
Use `agent_knock_knock_retry_callback` only for a `callback_failed` managed turn, for example `/akk retry-callback @a1b2c3d4`.
Submission retry remains part of `agent_knock_knock_send`, not callback retry or renewal. Use its exact `{turn_id}` form only from a current advertised `retry_submission` action and only after explicit confirmation. AKK never accepts replacement text from the caller, never clears the composer, and never sends Control-C. It first checks for native acceptance and repairs state without input when possible. Otherwise it fails closed unless it can prove the exact existing draft for one Enter, or prove both that Enter was never attempted and that the live composer is positively empty before retransmitting the immutable original request once. Any terminal, identity, route, draft, modal, approval, working-state, or one-shot reservation drift sends no further input.
Use `agent_knock_knock_close` only after the user explicitly asks to close the selected AKK Turn. That explicit choice has priority over stalled, deferred-transfer, Session, ledger, handoff, callback, or receipt conflicts: Close first records the Turn as closed and releases AKK management. It never sends terminal input, interrupts or stops the coding agent, or closes the terminal pane. Cleanup of linked AKK transfer, Session, ledger, and callback metadata is best-effort; preserve stale, malformed, or newer records and report warnings instead of refusing the user's Close. A callback attempt already in flight or accepted by the host may still arrive, but Close authorizes no new callback start or retry. Refresh `agent_knock_knock_list` afterward; if the coding agent is still working, explicitly Watch its exact `terminal_id` whether or not that row advertises the convenience action. Orphan terminal-dispatch/lifecycle recovery with `expected_message_id` or `expected_transition_id` remains a separate raw-terminal operation.
Use `/akk doctor` only for installation checks or troubleshooting.
## Terminal Approval
Approval is a sensitive action. On an unmanaged raw-terminal row, the terminal-scoped Codex approval action is prefilled with its exact `terminal_id`; never construct or guess that target.
A Terminal Watch approval callback is not an approval action. Notify the user and require them to inspect and decide in the live TUI; never continue with the steps below for a `watch_id`.
1. Call `agent_knock_knock_status`.
2. Show the detected request details to the user.
3. Require the user to explicitly choose one exact semantic decision advertised for that request: `approve_once` or, when present, `reject`.
4. For a managed Turn, call only the current advertised `approve({turn_id,decision})`. A terminal-scoped action supports `approve({terminal_id})` / `approve_once` only. Do not add a raw key, menu index, rendered label, token, or fingerprint.
AKK retains a private confirmation offer, then recaptures and revalidates the exact prompt, process, pane, owner, and decision under lock immediately before one approval key. If anything changed, the action fails closed and requires a fresh review.
For hookless Claude Code, the callback intentionally omits the raw command. Require the user to inspect the named live terminal pane personally; never decide from a hash or summary alone. Claude manual approval always permits only a strictly recognized one-time **Yes** choice and may additionally advertise semantic `reject` only when the exact supported menu proves a native **No** row. Codex approval likewise requires the current visible prompt and advertises `reject` only for an exact safe native rejection choice. A terminal-scoped Codex approval is manual-only, approve-once-only, carries `terminal_id`, leaves managed identity unchanged, and must not be retried blindly after an uncertain transport result.
Unknown, stale, expired, ambiguous, persistent-permission, replayed, or changed requests must not receive any decision key. If semantic `reject` is not advertised, tell the user to resolve the prompt directly in the terminal; use `agent_knock_knock_cancel` only when the user explicitly intends to interrupt the whole Turn, never as a disguised No choice.
A trusted, default-disabled plugin `autoApprove` policy may independently approve only an exact configured agent, command vector, and canonical root listed in `autoApprove.rules[].workspaces`, backed by current terminal evidence. A rule may list multiple workspace roots. These entries are the only workspace boundary for automatic approval; they do not limit pane discovery or manual control. The model cannot create or modify that policy.
## Terminal Sessions
The model-facing `agent_knock_knock_list` presents `conversations[]` once. Exact matched Codex terminal/backend representations are coalesced. A unique nonconflicting project pair prefers its backend entry without claiming an exact alias; ambiguous or attention-needed terminal records and unconnected Desktop candidates stay visible. Raw CLI output retains provider arrays for diagnostics. The terminal resource chain is terminal → verified native session → managed AKK `session_id` → Turns. Independent observations are queried through `watches` and addressed by `watch_id`. `process_state` reports process liveness; `screen_state` is bounded TUI evidence, `native_identity_state` is foreground identity resolution, and `durable_activity_state` is exact artifact-backed activity. `activity_state` can remain unknown even if the screen looks idle; none replaces advertised action authority. `managed.current_turn` is the current Turn. Historical contexts are absent from List. A human-driven thread mismatch remains `management_state="conflict"`; `external_handoff_adoptable` authorizes only the exact fenced Send advertised on the row, while `external_handoff_blocked` means do not send or guess recovery. Listing never adopts a new context.
### Compact controller-Host List projection
Host List returns `projection.schema="agent-knock-knock/host-list-compact"`, `projection.skill="agent-knock-knock"`, a projection version and the CLI action-contract version. Updated first-party OpenClaw, Pi and DeepSeek Harness connectors default to v5; generic SDK and MCP callers default to v4. Set `listProjectionVersion: 5` to opt in, or `listProjectionVersion: 4` for the v4 shape. An explicit parameter takes precedence; `terminalDebug: true` without an explicit version defaults to v4. Read `projection.version` before interpreting the response. For an unfamiliar version, make a fresh read-only List request for v4 or inspect an already known exact target with Status; do not infer write authority from unfamiliar fields.
Both formats omit repeated static `action_contracts`, static action `reason`/`use` text, Store paths, terminal diagnostics, native evidence, callback envelopes, historical requests, completion text, screens and event/file paths from the normal view. V5 additionally removes the derived per-conversation `usage` and a row's `id` when it equals `conversation_id`; use `conversation_id` when that redundant `id` is absent. Distinct IDs, readable enums, booleans, capabilities, current actions and dynamic inputs, exceptions and manual-action instructions retain their v4 meanings. A Claude row also retains structured `physical_send_readiness` (`ready`, `reason`, `message`) from its single exactly associated folded terminal control, preserving draft/stash/marker reasons previously explained only in `usage`. Explicit row-level facts take precedence; multiple controls do not select an assumed window. This adds no action authority. There are no integer codes, codebook or extra dictionary reads. Use this Skill for general guidance and exact Status for current details; bounded dynamic failure messages and scan errors remain visible.
The schema/catalog and Skill digests change for the new format, but action contract v35 remains unchanged: its no-existing-stash prerequisite still narrows Claude physical Send eligibility, and `physical_send_readiness` still explains draft, stash, legacy-marker, foreground-turn and footer blockers. Mutation parameters and guards are unchanged. The extra reader recheck and foreground background-view diagnosis are Claude-only. Use Status for one selected conversation, Turn or Watch and `/akk doctor` or the CLI for operator diagnostics.
**Conversation-only List:** List returns currently discoverable conversations, including Desktop sidebar entries with unconfirmed live owners. It never includes Watch inventories or retained managed history. Keep current ownership, blockers and advertised approvals; do not interpret missing Watch fields as missing Send monitoring. Use `agent_knock_knock_watches` or `/akk watches` to inspect observations. Legacy `listView="history"/"all"`, `all=true` and CLI `list --all` return a migration error.
Every Host List page has a total row limit (`listLimit`, default 40, maximum 100), a 24 KiB UTF-8 JSON ceiling and a conservative 12,000 weighted-character budget (ASCII 1, other code points 16), including metadata. This is not a token count or a native-read budget. Follow `pagination.next_args` unchanged while `has_more=true`; cursors are projection-version-bound, so start a fresh List rather than continuing across v4/v5. Desktop catalog pagination is separate: finish the Host pages, then use `desktop_scan.next_cursor` with the same Desktop filters and a fresh Host cursor. Discovery pages are live snapshots; restart if membership changes invalidate the cursor. No progress body is added to List. Oversized rows retain exact IDs, `details_omitted` and a Status entry point, without reintroducing `usage` in v5; omitted actions on those rows are not unsupported actions. Refresh exact Status before acting.
**Watch inventory:** `agent_knock_knock_watches` / `/akk watches` / CLI `watches` is a read-only Store query, defaulting to the most recent 24 hours, 40 rows per page (maximum 100), with a whole-response budget. `hours` accepts 1–48. Active or unresolved observations older than the window remain visible as `outside_window`; terminal managed Turns are a distinct section. Follow the returned pagination arguments. The query does not create/renew monitoring, reconcile or resend notifications. Use exact Status for actionable questions, approvals, callback recovery or full results. Native completion, controller acceptance and chat delivery are separate; `callback_expected=false` alone is neither failure nor delivery proof.
Healthy completed Watch bodies are eligible for bounded background cleanup after 48 hours. Active, pending-interaction and unresolved callback records are retained. Cleanup preserves minimal deduplication tombstones; an exact expired record reports `watch_history_expired` and forbids replay. Never resend an old task because its body was pruned. Managed Turns, Sessions and native history are not deleted. See `docs/list-output.md` for retention and migration details.
For every resource, `available_actions` is an object whose keys are the exact current semantic action names and whose values are `true`. `action_inputs` contains only dynamic semantic values that cannot be derived from the parent resource, plus scope, permitted decision values, and fields listed by `missing_required`; it does not repeat the same terminal/Session/Turn/Watch ID for every action. The parent `conversation_id` is the target for Send, Status, Watch and supported conversation settings; AKK chooses the operation route. V5 may omit an equal duplicate `id`, never the authoritative `conversation_id`. Capability-specific terminal controls retain their own exact `terminal_id`/`id`; managed and Watch records expose their own `session_id`, `turn_id`, or `watch_id`. `features` is only a compact capability-status summary and never authorizes an action. Never infer an absent action. The compact display is not the enforcement boundary: the plugin caches the complete private offer before projection, and the CLI re-observes and revalidates the live pane under its action lock before every mutation.
Action-name glossary:
- `status`: inspect one terminal, Turn, or Watch; it sends no native slash command.
- `send`: deliver a new request, or perform the separately advertised immutable `retry_submission` form.
- `watch` / `unwatch`: create or stop durable terminal observation; Codex 0.158.0/0.159.0/0.159.2/0.159.3/0.160.0/0.162.1/0.164.0/0.165.0/0.166.0/0.167.0/0.169.0/0.170.0/0.171.0 exact creation performs the closed `/status` transaction, while subsequent observation is read-only.
- `list_resumable_threads`, `new_thread`, and `resume_thread`: inspect or change native thread context through their closed lifecycle protocols.
- `native_inspect`: run only an advertised closed native inspection such as `status`.
- `model_options`, `repair_model_control`, and `set_model`: discover the current native catalog, clear only a proven model-control residue, or consume one catalog offer.
- `permission_options` and `set_permissions`: inspect one idle Codex pane’s built-in permission modes, then consume one catalog for the requested or authorized change, including Full Access without an extra confirmation. Ordinary Send never increases permissions.
- `identify_foreground` / `identify_and_send`: diagnose Codex foreground identity, or keep that diagnosis and one Send atomic.
- `reconcile_binding`: detach only the exact listed stale/conflicting AKK binding after explicit user confirmation.
- `transfer_store_authority`: explicitly transfer settled native-thread authority to this Host's Store through the `reconcile_binding` tool's `operation:"transfer_store_authority"` form; legacy maintenance acknowledgement must come from the user after source-Store Hosts and old writers have stopped.
- `respond`: answer ordinary text inside the current managed Turn.
- `respond_interaction`: answer one current native interaction step obtained from fresh Status; an `async_question` defaults to advertised `steer_current_turn` or accepts explicit advertised `queue_next_turn` as `delivery_mode`, while a blocking `questionnaire` omits it.
- `approve`: apply only an explicitly confirmed advertised semantic approval decision.
- `cancel`: interrupt the selected active Turn without closing the terminal.
- `renew`: extend an eligible stalled terminal Turn, or renew an exact backend task observation after identity verification.
- `retry_callback`: retry an eligible persisted callback without terminal input, retaining its original notification identity.
- `close`: release AKK management for the selected Send Turn without stopping the coding agent or closing its conversation.
- `recover`: reconcile an exact backend task and its receipt without resending work or changing its anchor.
The tool name is normally `agent_knock_knock_<action-name>`. List aliases are `retry_submission`, which invokes `agent_knock_knock_send` with its listed `turn_id` only after explicit confirmation, and `transfer_store_authority`, which invokes `agent_knock_knock_reconcile_binding` with the explicit transfer operation. Nested `handoff_decision.choices.take_over_current.action` and `blocking_turns[].recovery_action` carry their explicit tool/action name and semantic arguments; the explanatory choice and recovery text is defined here rather than repeated in every List row.
`available_actions` is the authoritative current-action source for mutations after listing except for the explicitly modeled nested handoff decision and `blocking_turns[].recovery_action`; user-selected `watch({terminal_id})` deliberately honors an exact user-selected terminal even without advertisement. A native interaction response instead requires the current `interaction_state` returned by Status in the same controller conversation. Approval, native interaction response, handoff takeover, and `reconcile_binding` require explicit user intent and fresh source state. Model-facing shapes include `permission_options({terminal_id})` and `set_permissions({terminal_id,mode})`; `model_options({terminal_id})`, the separately advertised Codex-only `repair_model_control({terminal_id})`, and `set_model({terminal_id,model,reasoning_effort})`; `watch({terminal_id})`; `send({session_id|terminal_id,request})`, with the targets mutually exclusive; `identify_foreground({terminal_id})`; `identify_and_send({terminal_id,request})`; `respond_interaction({turn_id|watch_id,interaction_id,answers,delivery_mode?})`, with exactly one subject id, only projected question/option ids, and `delivery_mode` present only for `async_question`; managed `approve({turn_id,decision})` or approve-once-only terminal-scoped `approve({terminal_id})`; `native_inspect({terminal_id,inspection})`; `new_thread({terminal_id})`; `resume_thread({terminal_id,native_thread_id})`; and `reconcile_binding({terminal_id,conflicting_session_id})` or its separately advertised `{operation:"transfer_store_authority",terminal_id,maintenance_acknowledgement?:true}` form. A top-level `previous` block, when present, is the only authority for a “previous/刚才那个” request; human-facing numbers and short IDs remain slash-navigation aids and are never structured tool arguments. The model never carries terminal, binding, catalog, candidate, composer, handoff, approval, interaction-fingerprint, revision, binding ID/generation, or handoff-only live-native-UUID fences; it never receives draft text or composer digests. `native_thread_id` remains the semantic resume identity. AKK derives those private fences and revalidates them before side effects. Orphan-close `expected_message_id` and `expected_transition_id` remain because they are entity IDs. Store format remains 1 and writer protocol is 11; Terminal Watch schema remains 3. Protocol 11 fences retired Session authority so predecessor writers cannot revive a source Session after Store authority transfer.
Before every terminal operation, AKK revalidates the expected agent PID and provider-owned terminal identity. Native inspection and lifecycle input require an exactly empty Composer; managed Send may require exact empty before input. Codex and Claude Code `terminal_user_explicit` instead require a scanned non-blocked approval state and no proven input-owning questionnaire, editor, menu, or read-only viewer. Reviewed Codex physical Send paths do not require ordinary main-Composer visibility, stability, or exactness. Claude physical Send requires an empty recognized main Composer, a known native footer, and no running or unproven foreground turn; background shells alone do not block it. Unreviewed Codex frontends require a recognized styled Composer before clearing and a fresh empty styled Composer before task text. For Codex, existing drafts and parsed working activity do not themselves veto the user-priority path, and after text injection no Composer observation may veto Enter. Once clear or request input may have occurred, an uncertain result must not be retried automatically. Humans can attach to the same tmux or Herdr session and continue directly at any time.
Exact-task Claude Code completion depends on a strictly correlated local transcript turn and fails closed for unknown schemas, unfinished foreground tools or stop hooks, ambiguous workflows, or identity drift. A returned Bash background launch alone does not invalidate an exact completed foreground reply; foreground completion is not proof that a background build succeeded. A `terminal_activity` Watch may separately notify that the selected terminal became stably idle only after observed activity; always label that callback best-effort and never report it as exact task completion or success.
## Final User Reply
Do not replay internal terminal-monitor or callback details.
Return:
- what was delivered;
- important files or behavior changed;
- verification performed;
- remaining issues, if any; or
- the actionable failure reason.
Codex 0.167.0 adds person-only `humanCommand` approvals. AKK does not claim the native human-approval capability. Such requests and unknown command kinds have no automated approval action; handle them in the original CLI. On 0.167 or newer, a screen-only command dialog cannot prove its native kind: use a verified structured backend approval or the original CLI. Ordinary backend approvals, file-edit approvals and question responses retain their existing contracts.
Ordinary paginated Codex Composer readiness is checked from the actual closed styled frame/footer, including a contextual model/path footer without a shortcut row; an unlisted release alone does not reject that shape. Drafts, unknown tails/modals, ownership conflicts and unresolved native identity remain guarded. Protocol-specific native terminal interactions still require their reviewed frontend/backend pair; prefer equivalent verified backend operations.
Codex 0.169.0+ attached CLI threads are not independent main CLI targets. Native moderation/display-directed messages are excluded from raw CLI public progress, final results and asynchronous questions; do not interpret missing public text as missing task completion. No new Cloud, deferred-output or lifecycle operation is implied.