46 lines
2.6 KiB
Markdown
46 lines
2.6 KiB
Markdown
# Web interaction recovery
|
|
|
|
The OpenCode V2 pending-permission list is location-scoped. Chat must use
|
|
`GET /api/session/{sessionID}/permission`, not `/api/permission/request`,
|
|
otherwise a browser can miss a request from another directory. Merely attaching
|
|
to a chat starts permission polling: the web must not require a new prompt to
|
|
show a CLI-originated approval. Deduplication belongs to the current room, not
|
|
the retained turn's historical seen-id set.
|
|
|
|
Pending questions are reconciled from `GET /api/session/{sessionID}/form`.
|
|
Unknown readback capability is distinct from an authoritative empty list, so an
|
|
unsupported backend cannot clear a live question. The browser retains each
|
|
request independently; answering one must not hide another. Draft question
|
|
answers survive streaming updates. Full approval resource text is expandable.
|
|
|
|
The controlled browser regression reloads with two pending approvals and two
|
|
questions, then checks that all four replies reach Go. It does not execute real
|
|
commands, alter permission configuration, or approve a production request.
|
|
|
|
## Typed interaction controls
|
|
|
|
Web form fields now preserve booleans and numbers (`false`/`0` are answers),
|
|
integer/range and length constraints, defaults, conditional visibility,
|
|
multiselect/custom values, masked secret inputs and HTTP(S)-only external links.
|
|
Hidden conditional answers are omitted. OpenCode forms offer cancellation through
|
|
their documented DELETE endpoint, without answering or rerunning the tool.
|
|
|
|
Codex command/file/network/permission approvals and standard MCP elicitation are
|
|
brokered over their original JSON-RPC callbacks. Session grants are labelled as
|
|
such. Responses are acknowledged only after the transport write succeeds;
|
|
foreign-session answers are refused. Schemas were checked against generated
|
|
protocol source tagged `rust-v0.163.0`, matching the installed package manifest.
|
|
|
|
## Live OpenCode check (2026-10-20)
|
|
|
|
A hidden verification chat in a separate temporary directory received a
|
|
synthetic shell-permission request matching the operator's existing ask rule.
|
|
No command was attached or executed, and no permission rule was changed.
|
|
The authenticated browser showed the real pending request without sending a
|
|
chat prompt, recovered it after reload, and delivered Reject to OpenCode.
|
|
The test browser alone seeded the hidden chat's real session record into its
|
|
list response so the ordinary route could open it; permission frames/replies
|
|
were not injected. The verification chat was closed afterward.
|
|
Capture: `hardening-captures/live-real-permission-pending.png` in the approved
|
|
OpenCode temporary artifact directory.
|