Skip to content

fix(mcp): accept digest settle results in the interaction output schema - #4458

Merged
thymikee merged 4 commits into
mainfrom
fix/mcp-settle-digest-schema
Nov 12, 2026
Merged

thymikee merged 4 commits into
mainfrom
fix/mcp-settle-digest-schema

Conversation

@thymikee

@thymikee thymikee commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

MCP clients rejected every settled press, click, fill, longpress, and hover result requested with responseLevel: "digest". Claude Code reported "Structured content does not match the tool's output schema: data/settle/diff must have required property 'lines'", so the agent lost a tap that had already landed. Observed in 12 of 179 device calls in an external agent run on 0.21.36.

Cause: the daemon settle digest drops diff.lines and keeps diff.summary plus settle.refs, but the advertised output schema still required lines. The daemon views and the MCP schemas have different owners, and nothing compared them.

  • lines is now optional in the settle observation schema, documented as absent at the digest level.
  • New guard test/output-economy/mcp-output-schema.test.ts: real daemon output (fake web provider) for snapshot, get, settled click with and without the tail, screenshot, and network, at default and digest levels, must validate against the advertised MCP outputSchema.

2 files.

Also fixes two flaky tests that fail other PRs' CI: the project-config leak check matched the CI temp path agent-device-test-run-12303 (now collision-free sentinels), and the tmpdir orphan test raced kill ESRCH when a runner exited between the liveness check and the signal.

Validation

  • Base origin/main schema: the new guard fails on settled click digest and settled click tail digest with $.settle.diff.lines: missing required property.
  • Head 1da1634376: 13/13 pass.
  • pnpm check:affected --run --head 1da1634376: all runnable checks passed (exactCommit=true).
  • Not device-facing (schema and test only).

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.21 MB 6.21 MB +95 B
Package (unpacked) 6.21 MB 6.21 MB +95 B
Package (download) 1.88 MB 1.88 MB +42 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.8 ms 18.6 ms -0.2 ms
CLI --help 38.3 ms 39.3 ms +0.9 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No findings.

1 finding below minor not shown (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (799e9c027625).

Feedback goes in the review comment threads, as a reply under the inline comment of a finding:

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Comment @apex-sentinel-staging review on this conversation to run a full review.

Earlier reviews

Review of 63d686ab · 12.11.2026 09:37 UTC

Apex Sentinel

Verdict: approve

Since the last review: 0 new · 0 still open · 1 no longer raised

No findings.

1 new finding away from what changed since 5a91529 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (799e9c027625).

Review of 5a91529f · 12.11.2026 09:25 UTC

Apex Sentinel

Verdict: approve

Since the last review: 1 new · 0 still open · 1 no longer raised (1 marked fixed)

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
src/__tests__/cli-config-trust.test.ts:40 🆕 Secret-echo assertion in cli-config-trust.test.ts is weakened with \b anchors, unrelated to this PR

Reviewed with this repository's own Sentinel configuration (799e9c027625).

Review of 1da16343 · 12.11.2026 09:08 UTC

Apex Sentinel

Verdict: approve

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
test/output-economy/mcp-output-schema.test.ts:27 New schema guard silently skips 8 of its 12 samples, asserting nothing

Reviewed with this repository's own Sentinel configuration (799e9c027625).

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 1da1634. The verdict and the full list are in the summary comment.

thymikee and others added 2 commits November 12, 2026 10:18
The settle digest drops diff.lines and keeps diff.summary plus settle.refs.
The advertised output schema still required lines, so MCP clients rejected
every press, click, fill, longpress, and hover result requested with
settle and responseLevel digest.

Guard the class: real daemon output for snapshot, get, settled click,
screenshot, and network at default and digest levels must validate against
the advertised MCP outputSchema.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the fix/mcp-settle-digest-schema branch from 1da1634 to 5a91529 Compare November 12, 2026 09:19

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 5a91529. The verdict and the full list are in the summary comment.

Comment thread src/__tests__/cli-config-trust.test.ts Resolved
The fixture value run-123 matched the CI temp directory
agent-device-test-run-12303, so the test failed whenever the runner's pid
started with 123. Unique sentinel values keep the substring match strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the fix/mcp-settle-digest-schema branch from 5a91529 to 63d686a Compare November 12, 2026 09:27
…he kill

Killing the probe ends its node --test runner, so the runner could exit
between isAlive() and process.kill(), and the test failed with kill ESRCH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

thymikee commented Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

The change in 19e5374 is ready: the schema now accepts digest settle results and the new guard test covers that case. I checked this by reading the validator, the digest view and the base required list. I did not run the tests locally.

Not blocking: one schema serves every response level, so diff.lines is now optional at the default level too, and a daemon regression that dropped it there would still validate. You can take or leave one extra assertion in the new test (settleDefault.settle.diff.lines is an array, settleDigest.settle.diff.lines is undefined). The PR body says "2 files" where the diff has 4, and the validation receipt names 1da1634 instead of 19e5374, so please update both before merge. The guard also samples only the click tool at digest, and the two flake fixes could be split out.

The three review threads are resolved, and none still applies: the schema is level-agnostic by design and is documented in the header comment (#4458 (comment)), the output-schema test thread is outdated (#4458 (comment)), and the config-trust fixtures are now collision-free (#4458 (comment)).

CI is still running for the Smoke Tests (including ios and macos) and Numeric Ranges, with no failures shown. The diff changes no daemon, backend or device code. Before merge, wait for those checks to finish.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 12, 2026
@thymikee
thymikee merged commit 51f0d27 into main Nov 12, 2026
20 checks passed
@thymikee
thymikee deleted the fix/mcp-settle-digest-schema branch November 12, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant