Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix \llm usage document, adding a help subcommand#1622

Merged
rolandwalker merged 1 commit intomainfrom
RW/fix-llm-usage-document
Feb 24, 2026
Merged

Fix \llm usage document, adding a help subcommand#1622
rolandwalker merged 1 commit intomainfrom
RW/fix-llm-usage-document

Conversation

@rolandwalker
Copy link
Contributor

Description

\llm without arguments was broken, as well as other special cases such as dependency warnings. There was also some (embarrassing) inappropriate debug output.

  • Return a SQLResult for each FinishIteration(), using the title property to get unformatted output.
  • Remove debug output.
  • Return the usage document for other arguments to \llm such as "help".

Maybe the title property to SQLResult should be renamed preamble, since I think it is used for unformatted frontmatter more than it is used for single-line titles.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Feb 24, 2026
@github-actions
Copy link

Findings (ordered by severity)

  1. Low: \llm commands that delegate to the external CLI with capture_output=False now return a dummy SQLResult, which always triggers output_res. This can introduce extra behavior (e.g., a timing line when \T is enabled) even though the external command already printed its own output. If that’s unintended, consider keeping FinishIteration(results=None) for the no-output path or introducing an explicit “no output” signal.
    File: mycli/packages/special/llm.py:267

Missing tests / edge cases

  1. Please add tests for \llm usage output with no args, help, and ?/\?, plus the dependency-missing path (ensures usage/help is printed without formatting regressions).
    Files: mycli/packages/special/llm.py:228-232

If you want, I can suggest a small test plan or add the tests.

@rolandwalker rolandwalker force-pushed the RW/fix-llm-usage-document branch 3 times, most recently from c0a09af to 28b3657 Compare February 24, 2026 11:09
\llm without arguments was broken, as well as other special cases such
as dependency warnings.  There was also some inappropriate debug
output.

 * return a SQLResult for each FinishIteration(), using the title
   property to get unformatted output
 * remove debug output
 * return the usage document for other arguments such as "help"
@rolandwalker rolandwalker force-pushed the RW/fix-llm-usage-document branch from 28b3657 to 240efad Compare February 24, 2026 20:29
@rolandwalker rolandwalker merged commit 9b92ee0 into main Feb 24, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/fix-llm-usage-document branch February 24, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants