Skip to content

feat(ask): add --inline-max-bytes per-run override - #1181

Merged
SamSaffron merged 1 commit into
SamSaffron:mainfrom
sam-saffron-jarvis:feat/ask-inline-max-bytes
Sep 26, 2026
Merged

SamSaffron merged 1 commit into
SamSaffron:mainfrom
sam-saffron-jarvis:feat/ask-inline-max-bytes

Conversation

@sam-saffron-jarvis

@sam-saffron-jarvis sam-saffron-jarvis commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds term-llm ask --inline-max-bytes <size> to override ask.stdin_inline_max_bytes for a single run.

Why

Since 2cc3b291 (structured ask input attachments), text from stdin / -f larger than ask.stdin_inline_max_bytes (default 10 KiB = 10240 bytes) is staged as a file and the model must read_file it. Scripted single-turn runs with deliberately large prompts break: the Jarvis daily digest passes a ~166 KB prompt with --max-turns 1 and failed three days running with agentic loop exceeded max turns (1). The only fix was a global config change; this makes it per-invocation.

Behaviour

  • Accepts plain bytes or human sizes via go-humanize: 4096, 512K (512,000), 2MiB (2,097,152).
  • Must be positive and ≤ ask.stdin_max_bytes (default 20 MiB = 20,971,520); errors otherwise, e.g. 50MiB → must not exceed ask.stdin_max_bytes (20971520).
  • Empty/unset leaves config untouched. stdin_max_bytes is never changed.
  • github.com/dustin/go-humanize moves from indirect to direct (already in the module graph).

Verification

  • New unit tests: parsing/validation table, and a ~168 KB text source that is staged under the 10 KiB default but inlined with 1MiB.
  • go test ./cmd, go build ./..., go vet ./cmd, make complexity pass.
  • Live: 180,030-byte file with a secret word at the end, --max-turns 1:
    • --inline-max-bytes 4K → agentic loop exceeded max turns (1)
    • --inline-max-bytes 1MiB → PERSIMMON
  • Docs: configuration reference + usage guide.

@SamSaffron
SamSaffron merged commit fb8e292 into SamSaffron:main Sep 26, 2026
6 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.

2 participants