Surface fork, save, and run guidance to CLI-driven agents#54
Merged
Conversation
The server now returns a next_step string on template fork (always) and workflow save (only for a hand-edited authored fork with checks), but the CLI's strict wire models silently dropped unknown fields. Add next_step to TemplateForkResult and WorkflowSaveResult and print it to stderr when present, mirroring how authoring_notes and deprecation_warning already render as advisory, non-blocking output.
The default markdown fetch path for templates get and workflows get already streamed the server's run_guidance in-band, so add a test confirming that. The --json fetch path is a separate story: it parses through TemplateDetail and WorkflowDetail, which lacked run_guidance, so the strengthened field was silently dropped. Add the field to both models and a test asserting it now appears in --json output.
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.
What
The server now returns two additive next-step guidance strings (on template fork and on workflow save) and strengthened run guidance on template and workflow fetches. The CLI re-parses server responses through strict wire models that drop undeclared fields, so these were silently lost for CLI-driven agents. This declares and renders them.
Changes
next_stepto the fork and save result models, andrun_guidanceto the template and workflow detail models. All optional with defaults, so responses from older servers still parse.next_stepto stderr when present (keeping machine-readable stdout clean), and nothing when absent, mirroring how advisory authoring notes render.--jsonfetch path via the new detail-model field.Testing
pre-commit (lint, format, type check) and the full test suite green (841 passed). New tests assert
next_steprenders present-only for both commands and that run guidance surfaces in both the markdown and--jsonfetch paths.Note
No version bump here; this pairs with the server REST additions and ships on the next coordinated release.
🤖 Generated with Claude Code