Skip to content

feat(responses): Add next-step runtime responses#420

Open
cameroncooke wants to merge 13 commits into
mainfrom
structured_next_steps
Open

feat(responses): Add next-step runtime responses#420
cameroncooke wants to merge 13 commits into
mainfrom
structured_next_steps

Conversation

@cameroncooke
Copy link
Copy Markdown
Collaborator

Add next-step instructions to CLI and MCP runtime responses across structured JSON and text output modes.

The motivation is to make runtime responses more useful for both people and agents without baking transport-specific verbosity policy into the runtime. Runtime now decides whether a response is minimal or normal, while CLI can expose that as an override: CLI defaults to normal, MCP defaults to minimal, and CLI callers can request the MCP-style minimal output when using the CLI from AI agents to save tokens.

This also refactors snapshot fixtures so coverage is explicit across the four supported output surfaces: MCP JSON, MCP text, CLI JSON, and CLI text. That makes future response contract changes easier to review because fixture expectations are grouped by runtime and output mode instead of being inferred from older shared fixture paths.

Reviewers should pay close attention to the structured-output envelope and schema version changes. The intent is to add/compact data inside the structured payload while preserving the standard envelope fields.

cameroncooke and others added 3 commits May 16, 2026 09:24
Add next-step instructions to runtime responses while keeping the structured
output envelope intact. The runtime now decides between minimal and normal
response detail without directly owning CLI verbosity policy.

Expose CLI control so regular CLI output can default to normal detail while
agent-oriented CLI usage can request minimal output matching MCP.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Restructure snapshot fixtures so CLI and MCP each have text and JSON coverage.
Add parity tests for both JSON fixture sets and update harness parsing to keep
runtime/output expectations explicit.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Record the runtime response and snapshot coverage changes in the unreleased
changelog.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 16, 2026

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@420

commit: b5b3323

@cameroncooke cameroncooke marked this pull request as ready for review May 16, 2026 08:27
Comment thread src/rendering/render.ts
Comment thread manifests/tools/boot_sim.yaml
Use the runtime option as the default text output style only when callers do
not pass an explicit output style. This keeps MCP resource rendering minimal
while still allowing CLI callers to opt into minimal output.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Global test filter silently skips device snapshot tests
    • Split the command into two separate vitest runs: one for device.snapshot.test.ts without filter to run all tests, and another for parity files with the filter to run only device workflow tests.

Create PR

Or push these changes by commenting:

@cursor push 51cb64f1df
Preview (51cb64f1df)
diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
     "test:schema-fixtures": "vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/json-fixture-schema.test.ts",
     "test:snapshot": "npm run build && node build/cli.js daemon stop 2>/dev/null; vitest run --config vitest.snapshot.config.ts",
     "test:snapshots": "npm run test:snapshot",
-    "test:snapshot:device": "npm run build && node build/cli.js daemon stop 2>/dev/null; vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/device.snapshot.test.ts src/snapshot-tests/__tests__/cli-json-fixture-parity.snapshot.test.ts src/snapshot-tests/__tests__/mcp-json-fixture-parity.snapshot.test.ts -t 'device workflow'",
+    "test:snapshot:device": "npm run build && node build/cli.js daemon stop 2>/dev/null; vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/device.snapshot.test.ts && vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/cli-json-fixture-parity.snapshot.test.ts src/snapshot-tests/__tests__/mcp-json-fixture-parity.snapshot.test.ts -t 'device workflow'",
     "test:snapshot:update": "npm run build && node build/cli.js daemon stop 2>/dev/null; UPDATE_SNAPSHOTS=1 vitest run --config vitest.snapshot.config.ts",
     "test:snapshots:update": "npm run test:snapshot:update",
     "test:smoke": "npm run build && vitest run --config vitest.smoke.config.ts",

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 392767d. Configure here.

Comment thread package.json Outdated
Run the device snapshot file separately from the JSON parity files so the
package script does not rely on a global Vitest name filter for every file.
Keep the device workflow filter scoped to the parity files where it selects
only the device suites.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Comment thread src/snapshot-tests/__fixtures__/cli/text/device/list--success.txt Outdated
Comment thread src/snapshot-tests/__tests__/session-management.snapshot.test.ts
Comment thread manifests/tools/xcode_ide_call_tool.yaml
Comment thread src/mcp/tools/project-discovery/show_build_settings.ts
Comment thread src/mcp/tools/debugging/debug_detach.ts
Comment thread src/snapshot-tests/json-normalize.ts Outdated
Comment thread src/utils/file-path-render-style.ts Outdated
Comment thread src/core/__tests__/structured-output-schema.test.ts
Comment thread src/utils/responses/next-steps-renderer.ts Outdated
cameroncooke and others added 4 commits May 16, 2026 14:41
Respect configured file path rendering before applying runtime verbosity defaults.
Append next steps to an existing text content item even when a later non-text
item is present, so mixed-content responses do not silently drop guidance.

Co-Authored-By: OpenAI Codex <codex@openai.com>
Return the current xcode bridge call-result schema version from daemon routed
invocations and update the JSON fixtures that exercise that contract.

Co-Authored-By: OpenAI Codex <codex@openai.com>
Cover additional CLI and MCP snapshot surfaces by normalizing volatile process,
device, Xcode, cache, and user values. Add the missing MCP text fixture for
session profile persistence so the runtime mode matrix stays complete.

Co-Authored-By: OpenAI Codex <codex@openai.com>
Reuse the filtered failed test case list instead of repeating the same predicate
for both detection and filtering.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@cameroncooke
Copy link
Copy Markdown
Collaborator Author

Validated the Cursor Bugbot autofix note for the device snapshot test filter. This was already fixed in 34fd3c7 by splitting test:snapshot:device into separate vitest invocations so the -t device workflow filter only applies to parity tests.

Comment thread src/snapshot-tests/suites/debugging-suite.ts
Comment thread src/mcp/tools/simulator-management/set_sim_location.ts
Comment thread src/utils/structured-output-envelope.ts
Comment thread src/mcp/tools/xcode-ide/shared.ts Outdated
Comment thread src/utils/typed-tool-factory.ts
Use the active snapshot runtime when rendering next steps through the direct test handler path so MCP snapshots exercise MCP-style next-step syntax instead of CLI syntax.
Use the same debugging error-path inputs across runtimes and normalize volatile SDK/group build-setting values so CLI/MCP text and JSON fixtures compare real output-mode differences instead of host environment details.
Require Xcode IDE bridge helpers to receive an explicit schema version and pass version 2 from status, sync, and disconnect callers.
Comment thread manifests/tools/swift_package_run.yaml
Comment thread src/snapshot-tests/__fixtures__/mcp/json/macos/stop--error-no-app.json Outdated
Add the missing swift_package_run manifest next-step template so daemon-routed CLI invocations can render the stop instruction from handler-provided nextStepParams.

Normalize PID string values in snapshot output so text and JSON fixtures use the same <PID> sentinel as numeric processId fields.
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