Repository navigation
feat(observe): appRequestKind tells approvals, questions and adapter-served calls apart - #137
Merged
Merged
Conversation
…served calls apart
A host that shows `app_request` parts cannot tell an approval from a
terminal call the adapter already served: the `type` is the runtime's own
method or subtype, and each runtime names the same ask differently.
`appRequestKind(type)` maps it to "approval" | "question" | "service" |
"unknown", exported from @botiverse/oar/observe and the root like
classifyTool. Unrecognised types are "unknown" so hosts keep showing them.
- approval: ACP session/request_permission; codex
item/{commandExecution,fileChange,permissions}/requestApproval; claude
can_use_tool; morph approval
- question: ACP elicitation/create; codex item/tool/requestUserInput and
mcpServer/elicitation/request; claude elicitation
- service: ACP terminal/{create,output,wait_for_exit,kill,release} and
fs/{read_text_file,write_text_file}
Record and contract types are unchanged. Tests pin the table, cross-check
the ACP names against the SDK's methods.client constants that
shared/acp/client-app.ts registers, classify every request the recorded
kimi and grok vendor runs sent, and fold claude control_requests through
the claude projection.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 5, 2026
Patch release: #137 (Ferryman) adds `appRequestKind(type)` to observe and the root: `approval`, `question`, `service` (a client call the adapter serves itself, such as an ACP terminal) or `unknown`. Version bump only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Oct 31, 2026
<!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_d6aec29df39540533f20f22961f6626f"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> Windows disposal could spend more than ten seconds capturing descendants before native shutdown: each failed CIM read had its own five-second limit, while waiting for a fresh serial batch was unbounded. The observed Claude 2.1.316 failure took 16.439 seconds and exceeded the unchanged 15-second behavior check. Give Windows before-EOF capture, force revalidation and post-exit revalidation separate five-second caller budgets, including queueing. Capture does not retry a timeout; another failure may retry once with only the remaining time. Expired callers report unverified cleanup and discard late identity evidence; force still stops the owned root. The one-second pre-cancellation observation uses the same deadline mechanism. Other platforms retain their existing cleanup policy. The first actually spawned Windows tree-owning line process starts one bounded background preparation through the serial reader. This includes short model, inventory and account probes that use that process abstraction; `runExecutable` help/version queries do not trigger it. Preparation never supplies cleanup identity evidence. Only completed cleanup retains a snapshot of its diagnostic metadata. Preparation alone does not keep the host alive: its timers, query process and pipe are unreferenced, while any foreground caller promotes the batch and retains its handles. Synchronous host-exit cleanup remains independent. The standalone behavior entry does not prewarm CIM, so Windows CI exercises the product's cold path with the existing 15-second disposal assertion. Native shutdown-hook grace is unchanged. Observation budgets do not bound total disposal: taskkill and native exit still have no hard deadline. The accepted tradeoff is that the slowest measured capture would report unverified cleanup near five seconds instead of recovering through retries after 11.4 seconds. The committed [report](https://github.com/botiverse/oar/blob/65b29c41ba54afc503bf407ba15a37ba7b0af558/experiments/windows-dispose-timing/README.md), probe, manifest and selection script preserve both Windows baseline groups from run 41193731535, including all 102 stops and physical query intervals. Batching remains effective; the slowest capture includes about five seconds of queueing. The original trace's remaining 6.418 seconds cannot be reconstructed by phase, and is not attributed to post-exit revalidation. The temporary workflow is not included. Validation: - Full `CI=1 pnpm run check`: 2,856 unit tests and 18 mock behavior cases passed; package builds passed. - All 14 behavior backends passed with bounded concurrency, including the native aimock/replay backends; Pi RPC normal and hanging native shutdown-hook regressions passed. - Regressions cover queued budgets, remaining retry time, no timeout retry, expired cancellation results, fresh capture after completed preparation, stable cleanup-only metadata, actual spawn semantics, and real host exit with background or foreground queries. Targeted mutations verify the budget, identity and handle-reference boundaries. - Downloaded baseline evidence is reproducibly selected byte-for-byte. Changed Windows product behavior and macOS checks remain subject to this PR's CI. Raft task #137. Release remains with Cindy after review and successful CI. --------- Co-authored-by: Otter <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new observe helper,
appRequestKind(type), returns"approval" | "question" | "service" | "unknown". It is exported from@botiverse/oar/observeand from the root, the same wayclassifyTool/groupToolActivityare. TheAppRequestKindtype is exported too. Its input is thetypeof anapp_requestevent, view part or pending request, which is the runtime's native method or subtype of atoApprequest.Why
A host that renders
app_requestparts can't currently tell an approval from a terminal call the adapter already served. Thetypeis the runtime's own name, and each runtime names the same request differently. Only OAR knows the mapping, so it lives inobserve/, asclassifyTool's does. Unrecognised types return"unknown"so hosts keep showing them. Record and contract types are unchanged.Names per class, and where each came from
session/request_permissionmethods.client.session.requestPermissionin@agentclientprotocol/sdk1.4.0, registered inshared/acp/client-app.ts;tests/acp/acp-session.test.tsitem/commandExecution/requestApprovalcodex app-server generate-json-schema(0.160.0)ServerRequest;tests/codex/codex-session-stream.test.tsitem/fileChange/requestApprovalitem/permissions/requestApprovalcan_use_toolcontrol_requestsubtype that claude 2.1.288 sends its host, recorded as the type byclaude/projection.ts;tests/events.test.tsapprovalcommunity/morph/tracker.tselicitation/createmethods.client.elicitation.create(SDK 1.4.0)item/tool/requestUserInputmcpServer/elicitation/requestelicitationcontrol_requestsubtype that claude 2.1.288 sends for an MCP server's questionterminal/create,terminal/output,terminal/wait_for_exit,terminal/kill,terminal/releasemethods.client.terminal.*(SDK 1.4.0), all served byshared/acp/client-app.ts; recorded in the kimi and grok vendor fixturesfs/read_text_file,fs/write_text_filemethods.client.fs.*(SDK 1.4.0)Left
unknownon purpose:item/tool/call: a dynamic tool the app runs, neither a question nor served by the adapter.account/chatgptAuthTokens/refreshandattestation/generate.execCommandApproval/applyPatchApproval: they only answer turns started through the v1 APIs, which OAR doesn't use.hook_callback,mcp_messageandrequest_user_dialog: these need hooks, SDK MCP servers or dialog kinds that the host declares, and OAR declares none.Notes:
fs: { readTextFile: false, writeTextFile: false }and registers no elicitation handler, sofs/*andelicitation/createcan't appear in a record today. They're classified so a future handler doesn't need a change here.observe/stays free of Node and adapter imports, and the codex and claude adapters record whatever method or subtype arrives, with no constant to derive a list from. The ACP names are instead checked by a test against the SDK constants thatclient-app.tsregisters.Tests
tests/app-requests.test.ts:methods.clientrequest constants (permission, terminal, fs, elicitation);tests/replay/fixtures/*-acp-v1.vendor.json), checked against"unknown";control_requestframes folded throughfoldClaudeStdout, so the projection's recorded type is what gets classified;"unknown"for unrecognised and prototype-like keys (toString,__proto__).pnpm run checkpasses (typecheck, lint, 607 tests passed / 31 skipped, mock sea-trial 19/19).pnpm run buildalso passes.🤖 Generated with Claude Code