Repository navigation
fix: warn that --format does not change files written by agents-as-code commands - #176
Open
danieldutu wants to merge 1 commit into
Open
danieldutu wants to merge 1 commit into
danieldutu wants to merge 1 commit into
Conversation
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.
agents pull --format yamlsucceeded silently and wrote JSON. The global--formatflag is defined with.global(true)insrc/app.rs:925-931, so clap accepts it on every subcommand, including the hand-written agents-as-code commands incli/elevenlabs/workflow/, which never read it. Pulled configs are always raw wire JSON, so the flag read as if it controlled the on-disk format and did nothing.Fix, three parts:
cli/elevenlabs/workflow/util.rsgainsformat_flag(next todry_run_flag) and one shared helper,warn_format_ignored, called at the top of all six push/pull handlers (agents/tools/tests). The warning goes to stderr and the command still runs:I chose warn over error so scripts that already pass
--format jsonfor logging keep working; the flag is genuinely accepted by clap, so failing felt like a behaviour break. If you prefer a hard error, it is a two-line change in the same helper.The global help now leads with the clarification: "Output format for printed API responses. Does not change files written to disk." I kept the remainder of the old help (format list, TTY default,
<NAME>_OUTPUTenv var, raw/jsonl/http descriptions) because that string is the only place those are documented.src/app.rsis hand-written (single author, not a Fern path), so I patched it directly.The README "Agents as Code" section now states that configs are always stored as JSON.
Commands run:
cargo test(839 passed), the types and sdk crate suites (38 and 118 passed),cargo check(clean). With the binary:agents pull --format yaml,--format yaml agents pull(flag before the subcommand),tools pull --format json,tests push --format csv,agents push --format jsoneach print the warning on stderr and continue; without the flag there is no warning. Two unit tests coverformat_flagafter and before the subcommand.Not covered:
agents init/add/statuswarn nothing — they are typed handlers whose parsed args never see the global matches (src/app.rs:489-497), so warning there needs the framework to pass matches to typed handlers. Say the word and I will take that on. The message says "agent configs" on all six commands; fortools pull/tests pusha per-family noun ("tool configs") would be more precise if you want it. Hiding--formatfrom these subcommands' help is a possible follow-up.Fixes #171.