Skip to content

to-human compatibility: no MAWS reader shows the plugin's made-up answer after a final message - #240

Merged
SSFSKIM merged 2 commits into
masterfrom
to-human-synthetic-rows
Oct 28, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
to-human-synthetic-rows

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

The record

to-human 0.7.0 (doperpowers PR #411, not merged yet) adds final: true to the plugin's message tool. After a final message, the plugin answers the engine's next step itself, with no API request. A terminal session's transcript JSONL then ends that turn with a made-up assistant record:

  • one text block, Message sent to the human.
  • answeredWithoutRequest: true
  • no requestId
  • a message id starting msg_hook_

The plugin's own view draws that record as nothing. MAWS reads terminal sessions' transcripts, so without this change it would show the record as a reply, count it, and take it as the session's latest line.

The change

isMadeUpFinalAnswer (src/shared/owner/message-call.ts) recognises the record the same way the plugin's view does when it reads the file: the answeredWithoutRequest flag plus the exact text. A model that writes the same sentence, and another hook's made-up answer, are still shown. The flag alone would also match the engine's other unrequested rows (2.1.311 sets it on every assistant item of a step answered without a request, including its patched tool-call rows). The msg_hook_ fallback isn't needed: the plugin pins the flag on disk in its live check and reads it on resume.

Readers that skip it:

  • Backfill (src/engine-host/fs/backfill.ts, assistantEvents). The record produces no events, like the engine's No response requested. marker. It still resets the tool-loop and API-error state, so the turn ends as before. This one change covers every reader that works from events: the chain follower (and through it the renderer's transcript model, the transcript store and main's digest), main's recent turns, the replay runner, and the desk's transcript, which maps rows through this backfill. The record stays on the chain as a record, so resume and rewind points don't move.
  • Summary (src/engine-host/fs/summarize.ts, lastAssistantLine). This feeds the index's lastAssistantText. It walks the tail newest first and passes over the record.
  • Search text (src/engine-host/fs/search-text.ts). Its worker embeds the predicate's source and doesn't index the record's words. The predicate is written to reference nothing outside its own body. The transpiled source was checked to be self-contained, and the review exercised the worker in a Rollup bundle.
  • The desk's off-chain reading (apps/desk-web/src/depth/source/off-chain.ts, isResponse). It no longer counts the record as a response that read the inputs before it. This was found in review: a delivery appended beside a final call and left off the chain was hidden instead of drawn as not read.

Readers left alone:

  • The live wire normalizer. The plugin registers its tool only in an interactive session. On engine 2.1.311's stream-json path, MAWS's -p launches raise session.start with isInteractive: false (cli.pretty.js, Noo({ … surface: null, isInteractive: !1 })). So the record can't come over MAWS's wire today.
  • The desk's other raw-row readers (landed-message.ts, asked.ts, desk-transcript.ts's modelOf). The record has no marks and no tool calls, so it matches none of their lookups. Its model is the session's own.
  • The owner projection (src/main/owner/projection.ts). It sees events only, and the record now produces none.

Logged instead of fixed: main's index caches a transcript's summary and search text until the file changes. A transcript that gained the record while its machine ran a MAWS without this change keeps the old line until the session writes again. None exists yet: a search of the MacBook's ~/.claude/projects found no "answeredWithoutRequest":true, and 0.7.0 is unreleased. The tracker row closes once every machine runs this change before 0.7.0 is installed there.

Tests

The fixture is test/fixtures/transcript-to-human-final.jsonl. It holds one turn: a prompt, a text and a Bash call in one response, then an accepted final mcp__to-human__message call, then the made-up record with the exact shape above, then turn_duration.

Each reader's test shows the record is gone from its output. Each also shows how the call before it reads:

  • In MAWS's own readers (summary, recent turns, digest, renderer under MAWS's names), the plugin's call is an ordinary tool call under P4 Decision Log 49. The latest line stays the text before it, and the call counts as work.
  • The same turn with the tool renamed to mcp__maws__message reads the call's message as the latest line.
  • The renderer model under the desk's names draws the call as a to_human row, the turn's last row.
  • The desk's off-chain case draws a delivery left beside the final call as not read.
  • The predicate has its own tests, including a model that writes the same sentence, another hook's answer, and an answer with more in it.

Mutation checks:

  • Removing any of the three event and record skips fails seven of the new tests: backfill 1, summary 1, search 1, recent turns 1, digest 1, renderer 2.
  • Removing the desk's check fails a drawingOf check of the same rows. The desk suite's own case runs only on CI; the local install lacks one of its modules.

Gates

Class 1a (--gates static,unit,probes --class1a pool) on head 18905dd, tree 0bb062877: run 40610858419, success on attempt 2.

  • Attempt 1 failed in unit 3/4 only. The failing test was desk-hub's org-directory.test.ts:403 ("is given up after 8 sends": expected 8 calls, received 10). That's the known shared-LocalHub counting flake. This branch changes nothing in desk-hub, and the same shard passed on the first head.
  • After gh run rerun --failed, every job passed.
  • The first head, a99fb03, ran as 40609514538. It failed static's typecheck on a test's object literal, which 18905dd fixes. Its unit shards and probes passed.

src/shared/owner/contract.ts (supplement 2) and MAWS's own mcp__maws__message are untouched.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…wer after a final message

to-human 0.7.0 (doperpowers #411) ends a turn on a final message without a request: the plugin answers the engine's next step itself, and a terminal session's transcript keeps that answer as the turn's last assistant record (one text block, 'Message sent to the human.', answeredWithoutRequest: true, no requestId, a msg_hook_ id). isMadeUpFinalAnswer (src/shared/owner/message-call.ts) knows it by the flag and the exact text, as the plugin's view does. The backfill maps it to no event, so the chain follower, the renderer's transcript model, the digest, the recent turns, the replay runner and the desk never meet it; the summary's last line and the search text's worker pass over it. The record stays on the chain.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…se; the predicate test typechecks; a tracker row for cached summaries

The review of a99fb03 found the desk's off-chain reading (apps/desk-web/src/depth/source/off-chain.ts, isResponse) taking the plugin's made-up answer as a response that read the inputs before it, so a delivery appended beside a final call and left off the chain was hidden rather than drawn as not read. isResponse now passes over it, as it passes over the engine's <synthetic> rows. The predicate test's record literal is typed so tsc's excess-property check (run 40609514538's static failure) passes. Main's index cache of a summary and search text read before the skip is logged as a tracker row: no local transcript holds the record yet.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T00:54:58.147379Z 18905dd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit d98c5e3 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…r hidden); the plugin must also register its tool in MAWS's non-interactive launches

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant