Skip to content

[pull] trunk from cli:trunk - #325

Merged
pull[bot] merged 3 commits into
All-Blockchains:trunkfrom
cli:trunk
Sep 2, 2026
Merged

[pull] trunk from cli:trunk#325
pull[bot] merged 3 commits into
All-Blockchains:trunkfrom
cli:trunk

Conversation

@pull

@pull pull Bot commented Sep 2, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

niik and others added 3 commits August 21, 2026 14:01
When an agent misuses a command, the terse usage string does not carry
the examples, JSON fields or environment variables it needs to correct
itself, forcing a second `--help` invocation.

Extract the help renderer out of rootHelpFunc so it can target any
writer, then use it from printError when an agent is detected. Rendering
directly to stderr avoids cmd.Help(), which writes to stdout and would
otherwise split a single failure across two streams.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A user-defined alias is a stub command: its own help carries no flags or
examples, only "Alias for ...". NewCmdRoot works around this by pointing the
alias's usage and help funcs at the command it expands to, but printError
calls root.WriteHelp directly and so bypassed that redirection.

The result was that agents got strictly worse output than humans for aliases:
`gh prs --badFlag` rendered 384 bytes of alias stub with none of `pr list`'s
flags, leaving the agent no way to correct itself. Resolve the alias inside
WriteHelp so the behaviour cannot be missed by a future call site.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d6afb36c-b3b5-472f-b540-025e38395b79
Print full help on command misuse for invoking agents
@pull pull Bot locked and limited conversation to collaborators Sep 2, 2026
@pull pull Bot added the ⤵️ pull label Sep 2, 2026
@pull
pull Bot merged commit 71eac35 into All-Blockchains:trunk Sep 2, 2026
0 of 10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant