Skip to content

docs: pass --code to the aichat commit-generation example - #4332

Merged
max-sixty merged 2 commits into
max-sixty:mainfrom
FenjuFu:docs/aichat-reasoning-code
Oct 1, 2026
Merged

max-sixty merged 2 commits into
max-sixty:mainfrom
FenjuFu:docs/aichat-reasoning-code

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4331.

With a reasoning model, aichat prints the reasoning in a <think> block before the answer, so the documented aichat command produced commits whose subject was <think>. This adds --code to the aichat example, which strips that block. Without a code fence in the output, the message passes through unchanged, and the default prompt already asks for no code blocks. A one-line note explains the flag.

src/cli/mod.rs and docs/src/content/docs/llm-commits.md are the hand-edited sources. The mirrors (docs/src/content/docs/config.md, skills/ and plugins/ references, dev/config.example.toml) the two help snapshots, and the bench-llm-commits command in Taskfile.yaml carry the same change.

Testing

  • Checked with aichat 0.30.0 and Spark-X2.5 (a reasoning model) by running the command the way Worktrunk does: bash -c '<command>' with the default commit prompt on stdin. Before the change the first line was <think>; after it, refactor(config): return Result from load. With thinking disabled, --code output was an ordinary message (details in aichat commit-generation example commits the model's <think> block with reasoning models #4331).
  • I couldn't run test_docs_are_in_sync or the help snapshot tests locally (no MSVC linker on this machine), so I edited the mirrors and snapshots by hand to match the generator's existing output for the neighbouring Codex entry. CI will confirm.

With a reasoning model, aichat prints the reasoning in a <think> block
ahead of the answer, and Worktrunk takes stdout verbatim, so the commit
subject becomes "<think>". aichat's --code flag strips that block and
leaves a message without code fences unchanged.

Signed-off-by: FenjuFu <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_taskfile_llm_commands_match_config_example fails on this head (code-coverage log). It asserts that Taskfile.yaml's bench-llm-commits commands match dev/config.example.toml, and the Taskfile entry is the one place still missing the flag:

COMMANDS["aichat"]='aichat -m claude:claude-haiku-4.5'

Adding --code there makes them match again, and every other aichat -m occurrence in the tree already has it. That line falls outside the diff, so it can't be an inline suggestion. I'm happy to push it as a commit if you'd like.

@FenjuFu

FenjuFu commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, added --code to the Taskfile entry in 67113e8.

@max-sixty
max-sixty enabled auto-merge (squash) October 1, 2026 08:54
@max-sixty
max-sixty merged commit ca8d379 into max-sixty:main Oct 1, 2026
38 checks passed
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.

aichat commit-generation example commits the model's <think> block with reasoning models

3 participants