feat(responses): Add next-step runtime responses#420
Open
cameroncooke wants to merge 13 commits into
Open
Conversation
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>
commit: |
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>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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.
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.
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>
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>
Collaborator
Author
|
Validated the Cursor Bugbot autofix note for the device snapshot test filter. This was already fixed in 34fd3c7 by splitting |
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.
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.
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.


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.