Repository navigation
sminos: a MAWS session's async asks read as the plugin's (board #76) - #243
Merged
Merged
Conversation
Board #76. A session under MAWS asks through mcp__maws__ask with blocking false. The call's result is {"status":"asked","askId":<call id>} as JSON, and the answer arrives later as MAWS's steer: the human's prompt, opening with `[MAWS ask <askId>]` and ending with the answered AskResult in a json fence. It is a user row when the session was idle, or a queued_command attachment when the engine took it into a running turn. _ask_events now reads that call, its acceptance and the steer beside the plugin's shapes: `question` at the acceptance, `answered` at the steer (the steer's answer lines), both with src set to the call id. The bridge's live export pairs a non-blocking MAWS call with its result, as it already did for the plugin's async ask. Fixtures come from MAWS's live-recorded transcripts (p1-maws-ask-async.jsonl; the mid-turn row is w1-steer-next-disk.jsonl's queued_command carrying the same steer), with attachments, thinking and per-machine fields stripped. Not fixed here: a session MAWS launches registers with entrypoint sdk-ts, and an sdk* entrypoint never joins a project on sight. Such a session is no member and still records nothing (TECH-DEBT, spec §9).
…st-id askId A Stop that read a MAWS ask call before its acceptance reached the transcript moved the export position past the call, so the next export saw the result without its call and the question was lost. The position now holds before every call of either ask tool. MAWS names an ask by the engine's tool-use id, else by its request id (askId = ctx.toolUseId ?? ctx.requestId), and steers it under the same id. An acceptance naming a request id was dropped while its steer still recorded answered; the question now records under the askId the acceptance names, so the pair correlates.
# Conflicts: # .claude-plugin/marketplace.json # .claude-plugin/plugin.json # .codex-plugin/plugin.json # package.json
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.
Board #76. A session under MAWS asks the human through MAWS's own tool,
mcp__maws__askwithblocking: false, and sminos's readers didn't know that shape. Now they do, in both export paths, so such an ask recordsquestionand thenansweredwith the same shape the plugin's async ask has, both withsrcset to the call id.The shape, read from MAWS's transcripts
tool_usemcp__maws__ask, input{title?, context?, blocking: false, questions: [{id?, question, header?, modality, options?: [{label, …}]}]}.questionandoptions[].labelare the plugin's field names, so thequestionevent is built the same way.tool_resulttext is JSON,{"status": "asked", "askId": <the call id>}. MAWS setsaskIdto the engine's tool-use id (src/engine-host/tool-server/ask.ts). A blocking call, or a subagent's call (MAWS treats every subagent ask as blocking), is answered{"status": "answered", …}in its own result and records nothing, as a blocking plugin ask records nothing.priority: nextprompt whose text opens with[MAWS ask <askId>] The user answered the questions you asked:, has one line per question, and ends with the answered AskResult in a json fence (askSteerText/parseAskSteer,src/shared/maws/ask.ts). It is written as auserrow when the session was idle. When the engine takes it into a running turn, it is written as aqueued_commandattachment (commandMode: prompt,origin.kind: human). Theansweredtext is the steer's answer lines (1. Proceed? — Yes), without the tag, the header or the fence.Fixtures:
tests/sminos/maws-ask-async.jsonlcomes from MAWS's live-recordedtest/fixtures/transcripts/p1-maws-ask-async.jsonl.maws-ask-async-midturn.jsonlputs the same steer into the realqueued_commandrow ofw1-steer-next-disk.jsonl. Attachments, thinking, paths and the classifier context are stripped.Changes
sminos.py:_ask_eventsreads MAWS's call, acceptance and steer beside the plugin's.srcis theaskIdthe acceptance names: the call id, or MAWS's request id when the engine named no call (askId = toolUseId ?? requestId), so the question and its steer always correlate.export_hostholds its position before an unresolved MAWS call, as it does for the plugin's.hooks/mods/bridge-rows.tsx: the bridge's live export pairs a non-blocking MAWS call with its result, as it already does for the plugin's async ask.run-sminos-tests.shcovers the idle steer and the mid-turn steer,chat --hostshowing the question open and then answered, and the cases that must record nothing (blocking, held, refused, a peer's quote of a steer, a steer whose result names another ask), an ask accepted under MAWS's request id, and a Stop that reads the call before its acceptance.bridge.test.tscovers the MAWS export.Not fixed here
A session MAWS launches is still not a project member, so this PR changes nothing visible for real MAWS sessions yet. MAWS launches every session with
CLAUDE_CODE_ENTRYPOINT=sdk-ts, andjoinablenever admits ansdk*entrypoint on sight (the M3 ruling against headless runs). As a result such a session records nojoined, no message and no question, and the desk has no presence or transcript for it. Admitting it is a membership decision, logged inTECH-DEBT.md.sdk-tsalone can't tell MAWS from other headless runs: this repo's owntests/claude-coderuns recordsdk-tstoo.Logged as T3: an answer reaches the log only at the next Stop. The bridge exports questions live but not answers, for the plugin's asks and for MAWS's.