Repository navigation
fix(mcp): accept digest settle results in the interaction output schema #4458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
698349d
fix(mcp): accept digest settle results in the interaction output schema
thymikee aacc4c3
docs(mcp): note that output schemas cover every response level
thymikee 63d686a
fix(test): use collision-free sentinels in the project-config leak check
thymikee 19e5374
fix(test): tolerate a pid that exits between the liveness check and t…
thymikee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { expect, test } from 'vitest'; | ||
| import type { CommandName } from '@agent-device/command-surface'; | ||
| import { listCommandTools } from '../../src/mcp/command-tools.ts'; | ||
| import { validateAgainstSchema } from '../../src/mcp/__tests__/output-schema-validator.ts'; | ||
| import { captureOutputEconomyDaemonResponses } from './daemon-route-fixtures.ts'; | ||
|
|
||
| const daemon = await captureOutputEconomyDaemonResponses(); | ||
|
|
||
| // Real daemon output at each response level, keyed by the command that produced it. | ||
| const samples: Array<[string, CommandName, Record<string, unknown>]> = [ | ||
| ['snapshot default', 'snapshot', daemon.snapshotDefault], | ||
| ['snapshot digest', 'snapshot', daemon.snapshotDigest], | ||
| ['get default', 'get', daemon.selectorDefault], | ||
| ['get digest', 'get', daemon.selectorDigest], | ||
| ['settled click default', 'click', daemon.settleDefault], | ||
| ['settled click digest', 'click', daemon.settleDigest], | ||
| ['settled click tail default', 'click', daemon.settleTailDefault], | ||
| ['settled click tail digest', 'click', daemon.settleTailDigest], | ||
| ['screenshot default', 'screenshot', daemon.screenshotDefault], | ||
| ['screenshot digest', 'screenshot', daemon.screenshotDigest], | ||
| ['network default', 'network', daemon.networkDefault], | ||
| ['network digest', 'network', daemon.networkDigest], | ||
| ]; | ||
|
|
||
| const outputSchemas = new Map(listCommandTools().map((tool) => [tool.name, tool.outputSchema])); | ||
| // A sample is checked once its tool advertises an outputSchema; untyped tools have nothing to violate. | ||
| const typedSamples = samples.flatMap(([label, name, data]) => { | ||
| const schema = outputSchemas.get(name); | ||
| return schema ? [[label, schema, data] as const] : []; | ||
| }); | ||
|
|
||
| test.each(typedSamples)( | ||
| '%s validates against the advertised MCP outputSchema', | ||
| (_label, schema, data) => { | ||
| expect(validateAgainstSchema(data, schema)).toEqual([]); | ||
| }, | ||
| ); | ||
|
|
||
| test('settled interaction output is checked at both response levels', () => { | ||
| expect(typedSamples.map(([label]) => label)).toEqual( | ||
| expect.arrayContaining(['settled click default', 'settled click digest']), | ||
| ); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.