claude-connector ask: no-tools completion CLI #2

Merged
eureka merged 3 commits from eureka-substrate/notool-ask-cli into main 2026-11-11 08:15:48 +00:00
Owner

Adds claude-connector ask: a subcommand of the existing binary (no new crate, no new target; one dependency line, rand_core, already in the lockfile) that gets a no-tools completion through ConnectorClient. Prompt on stdin, answer on stdout.

Usage: claude-connector ask --caller-id ID --connection-key-file FILE --model MODEL (--system TEXT | --system-file FILE) [--endpoint HOST:PORT] [--effort low|medium|high|max] [--max-output-tokens N] [--timeout-secs N] < prompt > answer

  • No tools, cwd or endpoint option: the request comes from ProviderRequest::new (empty tools).
  • Key from a file only, read as load_admissions reads it; zeroized; never echoed. Errors never carry key, prompt, instructions or the provider's failure message (only its kind).
  • Fresh request id per run, so the library's replay never answers a new question.
  • Default endpoint 127.0.0.1:4110 is a constant in ask.rs (the repo holds no config default for it).
  • README: fixed the stale "No connector binary exists yet", added a usage section.

Tests (crates/claude-connector/tests/ask.rs, real serve loop on loopback with a scripted backend, plus the binary): success text; fresh request ids; no-tools request; model outside allowed_models refused; output cap refused; wrong key / wrong caller; bad key files (missing, directory, empty, too long, binary, padded) without echo; empty answer; empty stdin before any connection; provider failure names kind only; timeout; dead endpoint; binary success and one-line stderr failure, tools/cwd flags rejected. A unit test in ask.rs runs the real backend planner: it accepts the asked request and refuses it once a tool is forced in.

Note: backend::tests::the_meter_call_reads_the_week_from_a_real_captured_event fails on main today (fixture reset time 2026-11-09 has passed); unrelated and untouched.

🤖 Generated with Claude Code

Adds `claude-connector ask`: a subcommand of the existing binary (no new crate, no new target; one dependency line, `rand_core`, already in the lockfile) that gets a no-tools completion through `ConnectorClient`. Prompt on stdin, answer on stdout. Usage: `claude-connector ask --caller-id ID --connection-key-file FILE --model MODEL (--system TEXT | --system-file FILE) [--endpoint HOST:PORT] [--effort low|medium|high|max] [--max-output-tokens N] [--timeout-secs N] < prompt > answer` - No tools, cwd or endpoint option: the request comes from `ProviderRequest::new` (empty tools). - Key from a file only, read as `load_admissions` reads it; zeroized; never echoed. Errors never carry key, prompt, instructions or the provider's failure message (only its kind). - Fresh request id per run, so the library's replay never answers a new question. - Default endpoint 127.0.0.1:4110 is a constant in `ask.rs` (the repo holds no config default for it). - README: fixed the stale "No connector binary exists yet", added a usage section. Tests (`crates/claude-connector/tests/ask.rs`, real serve loop on loopback with a scripted backend, plus the binary): success text; fresh request ids; no-tools request; model outside allowed_models refused; output cap refused; wrong key / wrong caller; bad key files (missing, directory, empty, too long, binary, padded) without echo; empty answer; empty stdin before any connection; provider failure names kind only; timeout; dead endpoint; binary success and one-line stderr failure, tools/cwd flags rejected. A unit test in `ask.rs` runs the real backend planner: it accepts the asked request and refuses it once a tool is forced in. Note: `backend::tests::the_meter_call_reads_the_week_from_a_real_captured_event` fails on main today (fixture reset time 2026-11-09 has passed); unrelated and untouched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Prompt on stdin, answer on stdout; no tools, cwd or endpoint options, key read
from a file, one-line stderr cause on every failure.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Key file: nonblocking open, regular file only, 1024-byte bound, refuse
group/world-readable. --system-file capped at 64 KiB. Tests drive a forced
tools request through the real serve loop and the real claude backend.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
main.rs still called read_to_string, leaving read_system_file dead. Binary-level
tests cover a FIFO, /dev/zero, 64KiB+1 and exactly 64KiB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
eureka merged commit 9d0f4b400c into main 2026-11-11 08:15:48 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/ModelConnector!2
No description provided.