# Changelog
All notable changes to xcodeai are documented here.
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Versions follow [Semantic Versioning](https://semver.org/).
---
## [0.4.2] — 2026-02-28
### Fixed
- Typing `exit`, `quit`, `q`, or `bye` at the prompt now exits immediately instead of being sent to the agent as a task
---
## [0.4.1] — 2026-02-28
### Fixed
- **`/connect` Copilot flow**: selecting GitHub Copilot from the `/connect` menu now immediately starts the device-code OAuth flow (shows code + opens browser), instead of just printing a hint to run `/login` separately
---
## [0.4.0] — 2026-02-28
### Added
- **Beautiful terminal UI**: styled welcome banner, colored output, and interactive menus using `console` + `dialoguer`
- **Interactive `/connect` menu**: select a provider from a numbered list — no manual URL/key entry required (GitHub Copilot, OpenAI, DeepSeek, Qwen, GLM, Ollama, Custom)
- **Styled prompt**: REPL prompt is now `xcodeai›` in cyan bold
- **Styled helpers**: `✓ ok`, `! warn`, `✗ err`, ` info` — consistent colored output throughout the REPL
### Changed
- **All REPL commands now use `/` prefix** instead of `:` (`/login`, `/logout`, `/connect`, `/model`, `/session`, `/clear`, `/help`, `/exit`)
- Default log level changed from `info` to `warn` — less noise in the styled REPL
- Task completion summary now shows iterations and tool calls inline with dim separators
---
## [0.3.0] — 2026-02-28
### Added
- **GitHub Copilot support**: use `xcodeai` with your Copilot subscription — no OpenAI key needed
- **Device-code OAuth flow**: `:login` opens GitHub authorization in the browser, persists the token to `~/.config/xcode/copilot_auth.json`
- **Auto token refresh**: Copilot API tokens (~25 min TTL) are refreshed transparently before every LLM call
- **REPL command `:login`**: start Copilot device-code authorization from within the REPL
- **REPL command `:logout`**: remove stored Copilot credentials
- **REPL command `:connect <url> [key]`**: switch provider inline (use `copilot` as the URL for Copilot)
- **REPL command `:model <name>`**: display current model / note model to use on next restart
- **Lazy API key check**: `xcodeai` starts without requiring any API key configured; auth errors surface only when a task is actually run
- **Auth status banner**: welcome screen now shows authentication status (Copilot auth state or provider URL)
### Changed
- `AgentContext::new` no longer bails on missing API key — callers validate lazily after checking provider mode
- `run` subcommand now skips key validation when provider is Copilot
- REPL `:help` updated to list all new commands
---
## [0.2.0] — 2026-02-28
### Added
- **Interactive REPL mode**: running `xcodeai` with no arguments now enters a persistent conversation loop
- Same session maintained across all tasks within one REPL session — full history preserved
- Command history with arrow-key navigation, stored at `~/.local/share/xcode/repl_history.txt`
- Special REPL commands: `:exit`, `:quit`, `:q`, `:session`, `:clear`, `:help`
- Top-level flags (`--project`, `--no-sandbox`, `--model`, `--provider-url`, `--api-key`) for REPL mode
- `xcodeai run <task>` continues to work exactly as before (non-interactive single-shot)
---
## [0.1.0] — 2026-02-28
Initial release.
### Added
**Core agent loop**
- Director → Orchestrator → Coder agent architecture
- Autonomous LLM ↔ tool loop — runs until task complete or `max_iterations` reached
- Context window management: keeps system prompt + most recent messages when near token limit
- Hard limits: `max_iterations` (default 25), `max_tool_calls_per_response` (default 10)
- Tool error recovery: errors passed back to LLM as tool results, agent decides how to continue
**LLM client**
- OpenAI-compatible streaming SSE client (`/v1/chat/completions`)
- Works with OpenAI, DeepSeek, Qwen, GLM, Ollama, and any OpenAI-compatible endpoint
- Streaming text printed to stdout as it arrives
- Exponential backoff retry for transient errors (429, 5xx), max 3 retries
- Tool call assembly from streaming SSE chunks
**Built-in tools**
- `file_read` — read file with line numbers, `offset`/`limit` for large files
- `file_write` — write or create files, creates parent directories automatically
- `file_edit` — string replacement in files, errors on missing or ambiguous matches
- `bash` — execute shell commands, 120s default timeout, 50KB output limit with head/tail truncation
- `glob_search` — find files by glob pattern, max 100 results sorted by modification time
- `grep_search` — search file contents by regex with file path, line number, and content, max 200 matches
**Configuration**
- JSON config file at `~/.config/xcode/config.json`, created with defaults on first run
- Environment variable overrides: `XCODE_API_KEY`, `XCODE_API_BASE`, `XCODE_MODEL`
- CLI flag overrides: `--api-key`, `--provider-url`, `--model`, `--project`, `--no-sandbox`
- Precedence: defaults → config file → env vars → CLI flags
**Session persistence**
- SQLite database at `~/.local/share/xcode/sessions.db`
- Stores full conversation history (all roles: system, user, assistant, tool)
- `xcodeai session list` — list recent sessions
- `xcodeai session show <id>` — show full conversation for a session
- Auto-generated session titles from first user message
**Sandboxing**
- Optional sbox integration for rootless user-space session isolation
- `--no-sandbox` flag and `sandbox.enabled: false` config for direct execution
- Graceful fallback when sbox is not installed
**CLI**
- `xcodeai run <message>` with `--project`, `--no-sandbox`, `--model`, `--provider-url`, `--api-key`
- `xcodeai session list [--limit N]`
- `xcodeai session show <id>`
- Clear error message when API key is missing
**Test suite**
- 58 unit tests covering config, LLM types, all 6 tools, agent loop, session persistence
- 4 integration tests using an axum mock SSE server (no real LLM required)
- Tests for: simple text response, tool call creating a file, LLM error handling, session persistence
[0.1.0]: https://crates.io/crates/xcodeai/0.1.0