Retire hardcoded stdout execute markers; render server run guidance#51
Merged
Conversation
The server text/markdown response now begins with a standing run-guidance directive composed in-band, so the CLI no longer prepends "# Goodeye workflow - execute the instructions below as the user's agent." or appends "# End of Goodeye workflow." around the body. The markdown payload is printed as-is (trailing-newline guard kept). Both the workflows get and templates get stdout paths are updated. Tests: updated the existing markdown-default tests for both commands to use a mock body that begins with the server directive, and added test_workflows_get_stdout_has_no_execute_markers and test_templates_get_stdout_has_no_execute_markers to assert the old markers are absent and the directive is the first thing on stdout.
The old name described the retired execute markers being present; the test body now asserts they are absent plus that the server body renders in stdout. Renamed to test_templates_get_stdout_renders_server_body and updated the docstring to match.
The workflow/template 'get' commands no longer wrap stdout with execute markers, so the help docstrings claiming the markdown is 'wrapped with agent-facing markers' were inaccurate. State plainly that the markdown prints to stdout by default.
The text/markdown fetch now carries the run-guidance directive in-band (prepended by the server), so writing that text to a file with --output put the directive ahead of the YAML front-matter. A later `publish` of the saved file would then fail to parse its front-matter and reject the missing name/description/outcome. Make `workflows get --output` and `templates get --output` fetch the structured record and write the directive-free body instead, so the saved file stays editable and re-publishable. Stdout (no --output) keeps streaming the server markdown verbatim, directive included, which is the intended runbook path. Correct the --output help text and add round-trip tests for both commands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 and why
The server now provides run-framing guidance in-band at the start of the markdown response when an agent fetches a workflow or template. That makes the CLI's own hardcoded execute-framing markers around
getstdout redundant and a source of drift, so this removes them: the CLI prints the server payload as-is and the run framing comes from a single server-owned source.What changed
workflows getandtemplates getstdout: removed the hardcoded prefix line ("# Goodeye workflow - execute the instructions below ...") and the suffix boundary marker ("# End of Goodeye workflow."). The command now writes the server markdown body directly (the trailing-newline behavior is unchanged).--jsonand--outputmodes are unchanged.Testing
Full suite green:
uv run pre-commit run --all-files && uv run pytest(826 passed).Release ordering (important)
Do not cut a release of this until the server change that adds the in-band guidance is live on production. If this ships first,
goodeye workflows get/templates getwould print a bare body with neither the old markers nor the new guidance. The CLI changelog entry (with the released version) is added at release time per the maintainer release runbook.🤖 Generated with Claude Code