Skip to content
Closed

Dev #111

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2fc02f6
fix: trim whitespace from file paths in read/edit/write tools
bobbyjohnstx Jul 16, 2026
c51496d
feat: serve OpenAPI spec and Scalar docs UI at /api/docs
bobbyjohnstx Jul 16, 2026
106697d
docs: add comprehensive user manual and deployment verification guide
bobbyjohnstx Jul 16, 2026
0746a6c
docs: add First 5 Minutes section to user guide
bobbyjohnstx Jul 16, 2026
2e1c931
fix: compose agent + base system prompts instead of substituting
bobbyjohnstx Aug 7, 2026
5fde705
refactor: separate tool infrastructure from personality in system pro…
bobbyjohnstx Aug 7, 2026
cd5f4ac
fix(tui): replace bare arrow keys with leader-key session navigation
bobbyjohnstx Aug 7, 2026
7bfb5cc
feat(tui): unified command palette and fix stuck dialog (#59, #86)
bobbyjohnstx Aug 7, 2026
c01ce3a
fix(agent): modelSizeB regex handles decimal sizes (#80)
bobbyjohnstx Aug 7, 2026
aeaf4b4
fix(ci): move TARGETARCH to global scope in Dockerfile (#83)
bobbyjohnstx Aug 7, 2026
6d08676
fix: await SSE event loop in non-interactive run mode (#84)
bobbyjohnstx Aug 7, 2026
d6b105c
feat(tui): surface subagent output inline in parent session (#87)
bobbyjohnstx Aug 7, 2026
e433582
chore: bump version to 1.17.0
bobbyjohnstx Aug 7, 2026
17fac28
fix(ci): add buildx setup to release workflow for multi-platform Docker
bobbyjohnstx Aug 7, 2026
cb9c032
docs: update for v1.17.0 — unified palette, hjkl nav, keybind changes
bobbyjohnstx Aug 7, 2026
41ade95
feat(provider): add OpenRouter as full-fledged provider with model di…
bobbyjohnstx Aug 10, 2026
b941ee4
docs: add OpenRouter discovery and /connect references across all docs
bobbyjohnstx Aug 10, 2026
6c02f6e
refactor(omt): move omt from plugin to native registration
bobbyjohnstx Aug 10, 2026
8f75401
chore: bump version to 1.17.1
bobbyjohnstx Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release edit ${{ github.ref_name }} --draft=false

- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4

- name: Log in to GHCR
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to npm and registries
env:
TINYCODE_VERSION: ${{ github.ref_name }}
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,51 @@

## [Unreleased]

## [1.17.1] — 2026-08-10

### Added
- OpenRouter as full-fledged provider with auto-discovery — set `OPENROUTER_API_KEY` to discover 300+ models with capability detection, pricing, and cost tracking
- OpenRouter in `/connect` TUI dialog for API key entry
- Tool-call failure tracking with warning toast after 3+ consecutive failures (#69)
- Auto-compact on model switch to smaller context window (#74)
- Model size field in config for custom/finetuned models (#75)
- Context warning for models with <8K context window (#77)

### Changed
- omt tools and system prompt injection moved from plugin to native registration
- Skip tool injection for models with `capabilities.toolcall=false` to save context tokens (#69)
- Sanitize markdown fences and trailing commas from malformed tool-call JSON (#69)

### Fixed
- oh-my-tiny tool schemas: nested `enum` arrays broke OpenAI strict JSON Schema validation
- Surface friendly error on ECONNREFUSED instead of stack trace (#76)

## [1.17.0] — 2026-08-07

### Added
- Unified command palette (`Ctrl+P`) searches across commands, agents, sessions, and skills with frecency ranking (#59)
- Subagent output rendered inline in parent session as collapsible preview (#87)
- Leader-key session navigation using vim-style hjkl (`<leader>h/j/k/l`) — replaces bare arrow keys (#88)
- OpenAPI spec and Scalar docs UI served at `/api/docs`
- First 5 Minutes quick-start section in user guide
- Comprehensive user manual and deployment verification guide

### Changed
- Session list moved from `<leader>l` to `<leader>o` (freed for sibling navigation)
- Code block concealment moved from `<leader>h` to `<leader>;` (freed for sibling navigation)
- System prompts: agent prompts compose with base instead of replacing
- System prompts: tool infrastructure separated from personality

### Fixed
- Command palette crash causing unrecoverable stuck/dimmed TUI state (#86)
- Non-interactive run mode (`bun dev run`) — SSE events now fully delivered before exit (#84)
- Docker multi-platform build — `TARGETARCH` moved to global scope in Dockerfile (#83)
- `modelSizeB` regex handles decimal model sizes like "3.5b" (#80)
- ErrorComponent double-fault from invalid `new URL("")` constructor
- Dialog-scoped ErrorBoundary for graceful dialog error recovery
- Release workflow: added buildx setup for multi-platform Docker builds
- File path whitespace trimming in read/edit/write tools

## [0.2.1] — 2026-07-06

### Added
Expand Down
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ Auto-generated from the OpenAPI spec. Regenerate with `./packages/sdk/js/script/
- **Dual runtime**: `src/storage/db.ts` and `src/pty/` use conditional imports (`#db`, `#pty`) to swap Bun vs Node implementations.
- **`bun dev` = `tinycode`**: During development, `bun dev` from the repo root is equivalent to the `tinycode` CLI.
- **Local LLMs first**: The primary use case is local LLM inference via Ollama, ramalama, or any OpenAI-compatible endpoint. Configure via `~/.config/tinycode/config.json`. ramalama support is enabled via `TINYCODE_RAMALAMA_HOST` env var (e.g., `http://localhost:8080`).
- **Provider filtering**: `enabled_providers` and `disabled_providers` in config apply to **all** providers — both custom API-configured providers and locally-discovered ones (Ollama, vLLM, ramalama, MaaS). Filters apply during discovery, so disabled providers are completely hidden from the provider list.
- **OpenRouter provider**: Full-fledged cloud provider with auto-discovery. Set `OPENROUTER_API_KEY` and tinycode discovers available models via the OpenRouter API, filtering to tool-capable models with pricing/capability mapping. Discovery runs in `src/provider/local-discovery.ts` alongside local provider polling. Uses `@openrouter/ai-sdk-provider` SDK. Cost tracking via OpenRouter's generation cost API (`src/session/llm.ts`).
- **Provider filtering**: `enabled_providers` and `disabled_providers` in config apply to **all** providers — both custom API-configured providers and locally-discovered ones (Ollama, vLLM, ramalama, MaaS, OpenRouter). Filters apply during discovery, so disabled providers are completely hidden from the provider list.
- **oh-my-tiny**: Built-in plugin at `src/omt/` providing extended orchestration tools (notepad, wiki, state management, AST grep).
- **ACP mode**: Run with `bun dev acp` or `tinycode acp` to enable IDE integration via the Agent Client Protocol. Communicates via stdio with editor extensions. See `docs/acp-integration.md` for developer guide.
- **Session tree sidebar** (`src/cli/cmd/tui/component/session-tree.tsx`): Toggleable ASCII tree showing session hierarchy. Press `<leader>b` in the TUI to toggle visibility. Sessions are organized by parent-child relationships.
Expand All @@ -159,5 +160,6 @@ Auto-generated from the OpenAPI spec. Regenerate with `./packages/sdk/js/script/
- **Skill parameter substitution**: Skills can declare `params:` in SKILL.md frontmatter (e.g., `params: [name, language]`). Parameters map to `$1`, `$2` placeholders in the skill content, substituted by `SessionPrompt.command()`.
- **Plugin marketplace**: Curated plugin registry at `src/plugin/registry.json` with search via `tinycode plugin-search [query]`. Plugin install resolves registry names to npm packages automatically.
- **Graceful shutdown**: `tinycode serve` handles SIGTERM/SIGINT — disposes all instances, emits global disposed event for SSE clients, then drains HTTP connections with 25s timeout.
- **Frecency ranking**: Command palette sorts by usage frequency via namespaced frecency store (`src/cli/cmd/tui/component/prompt/frecency.tsx`). File autocomplete also uses frecency.
- **Frecency ranking**: Command palette sorts by usage frequency via namespaced frecency store (`src/cli/cmd/tui/component/prompt/frecency.tsx`). File autocomplete also uses frecency. The unified palette (`ctrl+p`) searches across commands, agents, sessions, and skills — all categories use frecency.
- **Subagent output inline**: The `Task` TUI component renders subagent results as a collapsible block below the task header. Extracted from `<task_result>` XML in `props.output` using the `BlockTool`/`collapseToolOutput` pattern.
- **tc-doctor skill** (`src/skill/defaults/tc-doctor/`): Self-diagnostic skill with 14+ checks covering Ollama install/health, model availability, tool-call capability probe, ramalama provider, Mac-specific checks (Metal, Rosetta, RAM pressure), tinycode↔Ollama integration, vLLM provider health, and disk space. All checks use pure bash — no python3 dependency. Run with `/tc-doctor`.
10 changes: 2 additions & 8 deletions docs/UI-UX-REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,9 @@ The help dialog dumps raw markdown syntax — headers show as `## text`, tables

**Files:** `keybind.ts:43`, `tui-schema.ts:31`

### 6. Subagent navigation paradigm shift
### 6. Subagent navigation paradigm shift — RESOLVED

Parent → child: `ctrl+x j` (leader key chord)
Inside child: `up` (parent), `left/right` (prev/next siblings)
Arrow keys work because child view has no prompt, but this is non-obvious and undiscoverable without the SubagentFooter hint text.

**Fix:** Add `<leader>k` for parent (mirror of `<leader>j`) alongside arrow keys.

**Files:** `keybind.ts:98-101`, `subagent-footer.tsx:96-128`, `index.tsx:444-449`
Vim-style hjkl navigation: `<leader>h` (prev sibling), `<leader>j` (child), `<leader>k` (parent), `<leader>l` (next sibling). Bare arrow keys removed to avoid conflicts with OS window management (#88).

### 7. "tinycode" branding remnants (user-visible)

Expand Down
4 changes: 3 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ Plugin registry at `src/plugin/registry.json` provides a curated catalog of know

Auto-discovery polls every 30 seconds with a 2-second probe timeout (`src/provider/local-discovery.ts`).

OpenRouter is also auto-discovered when `OPENROUTER_API_KEY` is set. The probe fetches `https://openrouter.ai/api/v1/models` (5-second timeout), filters to tool-capable non-free models, and maps pricing/capabilities/limits. Uses `@openrouter/ai-sdk-provider` SDK with generation cost tracking via OpenRouter's billing API.

On startup, tinycode sends a warmup probe to the configured Ollama model (`src/provider/warmup.ts`). The probe sends a tool-call request to `/api/chat` with `keep_alive: "10m"`, pre-loading the model into GPU memory and verifying tool-calling capability. Results are shown as a toast (TUI) or footer message (direct mode).

### Bundled Cloud Providers (via Vercel AI SDK)

anthropic, openai, google, amazon-bedrock, azure, google-vertex, xai, mistral, groq, deepinfra, cerebras, cohere, openrouter, togetherai, perplexity, vercel, alibaba, gateway, gitlab, venice, and any generic openai-compatible endpoint.
anthropic, openai, google, amazon-bedrock, azure, google-vertex, xai, mistral, groq, deepinfra, cerebras, cohere, openrouter, togetherai, perplexity, vercel, alibaba, gateway, gitlab, venice, and any generic openai-compatible endpoint. OpenRouter is the only cloud provider with auto-discovery — others require manual model selection from the bundled catalog.

### Plugin Providers

Expand Down
21 changes: 11 additions & 10 deletions docs/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Quick reference for the most common keyboard shortcuts, agents, and commands.
|-----|--------|
| `Ctrl+C` or `Ctrl+D` or `<leader>q` | Exit tinycode |
| `F1` | Open help dialog |
| `Ctrl+P` | Show command palette |
| `<leader>l` | List all sessions |
| `Ctrl+P` | Command palette (commands, agents, sessions, skills) |
| `<leader>o` | List all sessions |
| `<leader>n` | Create a new session |
| `<leader>j` / `<leader>k` | Go to first/parent child session |
| `left` / `right` | Cycle to previous/next child session |
| `<leader>h` / `<leader>l` | Previous/next sibling session |
| `<leader>j` / `<leader>k` | Go to first child / parent session |
| `<leader>m` | List available models |
| `F2` / `Shift+F2` | Cycle to next/previous recent model |
| `<leader>a` | List available agents |
Expand All @@ -28,7 +28,7 @@ Quick reference for the most common keyboard shortcuts, agents, and commands.
| `<leader>x` | Export session transcript |
| `<leader>y` | Copy message |
| `<leader>u` / `<leader>r` | Undo/redo message |
| `<leader>h` | Toggle code block concealment |
| `<leader>;` | Toggle code block concealment |
| `Ctrl+R` | Rename session |
| `Ctrl+D` | Delete session |
| `Escape` | Interrupt current session |
Expand Down Expand Up @@ -133,11 +133,12 @@ Follow the suggestions
Write guide for new developers on session architecture
```

### Session navigation
### Session navigation (vim-style hjkl)
```
<leader>h # Go to previous sibling session
<leader>j # Go to first child session
<leader>k / up # Go to parent session
left / right # Cycle through siblings
<leader>k # Go to parent session
<leader>l # Go to next sibling session
```

## Configuration
Expand All @@ -146,7 +147,7 @@ Edit `~/.config/tinycode/config.json`:

```json
{
"model": "ollama/qwen3.5:9b",
"model": "ollama/qwen2.5:latest",
"lsp": true
}
```
Expand Down Expand Up @@ -175,7 +176,7 @@ After listing models (`<leader>m`):
- Use `<leader>c` to compact a session before exporting
- Export to HTML with `tinycode export --format html <session-id>`
- Type `@filename` to reference a file in your prompt
- Use `<leader>h` to collapse code blocks and focus on analysis
- Use `<leader>;` to collapse code blocks and focus on analysis
- Session tree shows hierarchy with `<leader>b`
- **Model warmup:** On startup, tinycode probes the Ollama model to verify tool-call support and pre-load it into GPU memory. Look for "qwen3.5:9b ready — tool calling supported" in the toast/footer
- **Tool-call warnings:** If you see "Multiple tool call failures detected," switch to a larger model via `<leader>m` — tinycode auto-repairs common JSON issues, but very small models may not support tool calling at all
Loading
Loading