Skip to content

observe: what an unanswered question asks, on its part, and pending requests whose turn ended #263

Closed

Description

@xxchan

What happened

Ferry runs claude and codex in full-permission mode. They don't ask for approvals, but a question (an MCP server's elicitation through claude control_request subtype elicitation, codex mcpServer/elicitation/request / item/tool/requestUserInput) still blocks the turn: oar records the toApp request and answers nothing (by design until a host-answer API exists), so status stays running until the host stops the turn.

Showing that state well from @botiverse/oar/observe (0.45.1) runs into three gaps:

  1. The app_request view part never carries its body. ViewPart declares body?: unknown on app_request, but session-view-events.ts pushes the part without it; only pendingRequests[].body (filled by recordFacts) has it, and only while unanswered. A host that presents a turn from the turn alone (Ferry's iOS bridge diffs by message identity) can't say what was asked without reaching into the view.
  2. No words for what a request asks. appRequestKind maps each runtime's request types to approval/question/service, but the text of the ask lives in runtime-native bodies only oar knows (request.message for claude, message for codex/ACP elicitation, questions[0].question for codex requestUserInput). Ferry now reads these itself (packages/core/src/asks.ts, questionText), which is exactly the per-runtime knowledge appRequestKind's doc says belongs in oar.
  3. pendingRequests keeps requests whose turn ended. After the host aborts a turn holding an unanswered question (claude cancels its elicitation on interrupt; no response record is written), the request stays in SessionView.pendingRequests for the rest of the run, so pendingRequests.length > 0 no longer means "someone is waited on". Ferry now only counts the open turn's unanswered requests.

Suggestion

  • Fill body on the app_request part (the same native body pendingRequests gets).
  • Export something like appRequestText(type, body): string | undefined (or a { kind, text } reading) beside appRequestKind, covering claude/codex/ACP elicitation and codex requestUserInput (and the tool name of an approval).
  • Either drop a pending request at its root turn's end, or mark it (turnEnded: true) so a host can tell a live ask from a dead one without re-deriving turn membership.

Context: Ferry D101 (botiverse/ferry, branch stuck-question); the host-answer API itself is Ferry roadmap D013.

Activity

  1. xxchan commented on Oct 9, 2026

    @xxchan
    MemberAuthor

    Decided

    All three, with one change to the third: the end of a pending request comes from the runtime's own report, never from the turn ending.

    1. body on the app_request part. ViewPart declares it and the fold never fills it: a bug. Fill it with the same native body pendingRequests carries.

    2. appRequestText(type, body): string | undefined beside appRequestKind, same rationale: which field holds the ask is per-runtime knowledge only OAR has. Questions: claude elicitation request.message; codex mcpServer/elicitation/request message; codex item/tool/requestUserInput every questions[].question, one per line; ACP elicitation/create message (none arrive today: OAR advertises no elicitation). Approvals, where the native field names the action plainly: claude can_use_tool request.tool_name, codex item/commandExecution/requestApproval command, ACP session/request_permission toolCall.title. Each source cited from the schema or a recorded frame; anything else is undefined, never a guess.

    3. A request the runtime withdrew leaves pendingRequests, on the runtime's word. Both runtimes say so themselves and OAR drops it today:

      • claude writes {"type":"control_cancel_request","request_id":…} when it cancels a request it sent (2.1.292 has three emitters); OAR records it as a frame with no event.
      • codex 0.160.1 notifies serverRequest/resolved {threadId, requestId} (v2/ServerRequestResolvedNotification). OAR never answers a codex request, so this always means codex cleared it.

      New event app_request_cancelled {requestId} read off those frames; SessionView removes the request from pendingRequests and settles its part as cancelled. The process exit also settles every pending request (whoever asked is gone). Not "drop at turn end": a runtime may keep a request open across a turn boundary, and inferring it from the turn would put a guess in the view.

    Verification: a claude probe that interrupts a turn holding an elicitation and shows the cancel frame; a codex fixture for serverRequest/resolved. Taking this myself after oar#262; both ship in the same release for Ferry.

  2. added a commit that references this issue on Oct 9, 2026
    c588d4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions