hey 0.1.0

Minimal terminal AI coding agent: kernel loop + MCP/Skills self-evolution
Documentation
# Changelog

## [Unreleased] - 2026-09

Post-0.1.0 hardening pass: terminal robustness, output cleanup, session history
replay, real-model verification, cross-platform CI, and lint strictness.

### Terminal & Ctrl-C

- Double Ctrl-C clean exit: removed `_exit(130)` from the signal path so
  rustyline's `disable_raw_mode()` (bracketed paste, termios) runs before
  exit; atexit only does termios sanitization (`stty sane` equivalent) with
  **no** background SIGINT to the shell (was investigated, dropped as a
  side-effectful hack)
- Fixed Ctrl-C during streaming (libc::sigaction re-installed before each
  turn; tokio signalfd unusable in env), input-duplication on cancel, and
  thinking→text newline separation
- REPL Tab completion actually enabled (missing `set_helper` call)
- ESC-break removed (side-effectful); Ctrl-C two-stage at the prompt
  (first clears line, second exits)

### Session history

- Full history replay on resume: thinking / text / tool calls / tool results
  rendered in real-interaction UI format (no truncation, `> ` user prefix,
  grey thinking, `[hey] tool: ...` / `[hey] ... ok`)
- Fixed first-response duplication on resume (persist loop index shift)

### Output & UX

- Silent `finished` / `usage` / resume-compaction noise in terminal
  (`/usage` covers detailed queries; JSON stream still emits events)
- Removed startup banner (use `--version`); /help grouped by category
- MCP errors: `[hey] mcp '<name>' skipped: <reason>` one-liner, child
  stderr discarded (kills npx/npm install notice spam), success silent

### Protocols & real-world

- OpenAI Responses API adapter (`llm/responses.rs`) for o3/gpt-5 family
  (reasoning via `reasoning.summary`)
- OpenRouter `reasoning` field parsing alongside DeepSeek `reasoning_content`
- Real-model E2E tests (`tests/e2e_live.rs`) via kilo gateway
- `scripts/smoke-real.sh` extended: kilo text / Context7 remote MCP /
  filesystem stdio MCP / SOCKS5 proxy (4/4 passing); fixed filesystem
  test-path outside allowed dir
- `scripts/bench.sh` to bypass cargo bench file-lock; SSE + core benchmarks

### Quality & tooling

- `clippy::pedantic` enabled (priority -1) with a curated allow-list;
  16 real fixes (map_or, write! over push_str, if-let/let-else, merged
  identical match arms)
- Cross-platform CI (Windows/macOS/Linux) added
- README: kilo gateway, Context7 + filesystem MCP, SOCKS5+MCP combo example
- DESIGN.md: responses.rs documented
- All commits verified: `cargo test` 14 suites green, clippy zero warnings,
  real-model smoke 4/4, bench within noise

## [0.1.0] - 2026-08-19

First tagged release. A minimal terminal AI coding agent in Rust with a
protocol-agnostic core, MCP + Skills extension channels, and a hardened
quality baseline (164 tests / clippy -D warnings / fmt / doc / MSRV 1.88).

### Core & protocols

- Protocol-agnostic kernel: unified IR (`llm/ir.rs`) + adapters for OpenAI,
  Anthropic, and Google (`/v1beta` streamGenerateContent), all verified
  against a real multi-protocol gateway (text + tool calls)
- Thinking unified across protocols: `--effort` (OpenAI) / `--budget`
  (Anthropic/Google) mapped to native semantics; `off` normalized
- Layered timeouts (request + turn, side-effect-free by default),
  turn-level retry with Retry-After respect, budget-aware context pruning
- SSE robustness: unexpected stream interruption detection (per-protocol),
  non-SSE responses rejected with clear errors, base_url trailing-slash
  normalization, proxy handling with localhost default exclusion

### Agent loop

- `agent.rs` split into `agent/{prompt,context,execution,compress}`:
  dynamic system prompt (AGENTS.md + skills), DCP-style context pruning
  (dedup / error cleanup / compress / nudge), parallel tool execution with
  pi-style permission allow-lists, `--approve` headless trust entry
- Compaction results persisted to sessions (reused on resume, token usage
  accounted); `compat_resume` token window aligned with pi keepRecentTokens
- Session write failures escalate: first failure `error!`, later `warn!`

### Tools & MCP

- 5 built-in tools (`bash` / `read_file` / `write_file` / `edit` / `grep`)
  + `compress`; bash output filtering reworked after studying rtk:
  no line-level dedup, error blocks with indented context, full-output
  tee to `.hey/tool-log/` when truncated/failed (recoverable, no re-run),
  10 MiB capture cap; `git diff/status/log/show` output never filtered
- MCP: stdio + HTTP/SSE transports, parallel server connections, tool-call
  timeouts, crash-restart policy (pi-style fail-fast by default)

### Sessions & REPL

- Append-only JSONL sessions (0600), `--sessions-dir`, resume with lossless
  summary + window rebuild for oversized histories
- REPL with `/usage` `/compact` `/model` `/reload` `/skill:<name>`

### Quality & tooling

- CI (GitHub Actions): fmt / clippy -D warnings / test / RustSec audit /
  doc -D warnings / MSRV 1.88 guard — all green
- Real-gateway smoke (`scripts/smoke-real.sh`) and coding benchmark
  (`scripts/bench-real.sh`, T1-T5, 4/5 on the regression run) with
  worktree isolation + leak guard
- Full-repo rustfmt, .gitattributes (LF), dependency security refresh