Skip to content

SHAI v0.2.1 - #118

Merged
AxelDum merged 83 commits into
ovh:mainfrom
AxelDum:main
Oct 8, 2026
Merged

AxelDum merged 83 commits into
ovh:mainfrom
AxelDum:main

Conversation

@AxelDum

@AxelDum AxelDum commented Oct 7, 2026

Copy link
Copy Markdown
Member

v0.2.1

This version focus on improving the TUI with new feature and fixes.

Interface (TUI)

  • Update ratatui to v0.30.2
  • Migrate from cli-clipboard to arboard
  • Add /session (session picker) and /pwd (working directory) commands
  • Change /tokens from status bar notification to rendered text block
  • Add ◆ system message marker with add_system_text for command outputs
  • Show custom function call in status bar when set
  • Add symbols in status bar

Fix

  • Fix ? help tab spacing (replaced \t with padded formatting)
  • Fix session/agent picker transparency with Clear widget + background fill
  • Fix /auth black page by dropping terminal before LeaveAlternateScreen
    and removing terminal.clear() that blocked on EventStream mutex
  • Fix /mcp, /skills, /tools rendering by removing dead clear/insert_before
    calls (no-op for Viewport::Fullscreen) and adding empty-state guards

v0.2.0

This version focus on general improvement on SHAI, include SKILLS and AGENTS.md support, general improvement on agent harness, auto/plan mode and session restoration

Breaking change/deprecation

  • headless: shai "prompt", should use shai -p "prompt"
  • config: configuration are know prefix with .json, existing config are migrated at first launch
  • tui: setting shortcut through env var is deprecated in favor of tui.config.json, if a config does not exist and env var exist a new configuration is created. env var have no effect if a config exist.

Agent feature

  • Add native support for agent.md
  • Add native support skills.md (details : docs/skills.md)
  • Add native support for memory
  • Add support for sessions and sessions restoration (/restore)
  • Add support for Claude/Cursor config file
  • Add support for manual/auto/plan mode (shift+tab cycling)

Interface (TUI)

  • Add a file in chat with @ shortcut
  • Status bar : Add location, git branch, agent mode, token usage
  • Implement better highlighting for multiple language
  • Default to full screen instead of inline in the shell
  • Reduce ls, find, read tool verbosity to a one liner with file path / search pattern
  • Add support for command history
  • Add color diff for git
  • Better UI resizing
  • /auth is now avalaible in the interactive tui
  • /mcp list mcp and their active status
  • a new tui.config.json to configure port mapping (details : docs/configuration/tui.md)
  • Multiple command improvement (details : docs/cli-reference.md)

Harness

  • Add batch read/edit tools
  • Add support for line hash edition
  • Add support for tools compaction
  • Limit impact of huge read >2000 char
  • Allow models temperature change
  • Implement read caching
  • Implement AST parsing for read for multiple languages
  • Implement auto-verification on edit for 10 languages
  • Implement progressive compaction to limit context growth of multi turn session
  • Improve tool documentation so model can better leverage built-in tool

Fix

  • Config is not override if malformed
  • Fix some issue with the permission modal which could hang shai

AxelDum and others added 30 commits October 7, 2026 12:25
Move SessionPersist and SessionData from shai-http to shai-core so they can be reused by the CLI. Update imports in shai-http session modules accordingly.
Add memory_write and memory_read tools that persist project facts to .shai/memory.md. Register them in the agent builder and tool module.
Add skill discovery and a skill tool for loading on-demand procedural instructions from .shai/skills/ and ~/.config/shai/skills/. Migrate project context from SHAI.md to AGENTS.md convention while keeping SHAI.md as a legacy override. Add find_git_root() helper to walk up to the nearest .git directory.
Add a status bar showing model/provider/token usage, a conversation history buffer, command autocomplete with '/' prefix, keyboard shortcuts (Ctrl+T, Ctrl+V, Alt+Enter), and /restore command for session persistence and restoration. Remove unused cmdnav module.
Add green/red ANSI coloring for added/removed lines in diff previews shown by the pretty formatter.
Cast handle_sigwinch to *const () before converting to usize to satisfy the sa_sigaction field type on platforms where it differs.
Add comprehensive skills documentation covering creation, discovery, and usage. Add project roadmap.
Bump version to 0.2.0 with new features: memory tools, skills system, TUI improvements, and AGENTS.md support.
Add exponential backoff retry mechanism for chat and chat_stream
requests. Retries cover network errors, 5xx responses, and
deserialization errors. Max retries configurable via SHAI_LLM_MAX_RETRIES env var.
Replace loose 'contains' checks with exact path matching and proper
directory prefix matching. Wildcard patterns now use starts_with/ends_with
instead of contains for more accurate filtering.
- Wire status bar to display agent model, provider, and state
- Add render_restored_trace to display loaded conversations in TUI
- Suppress agent banner when terminal is already initialized
- Restore keyboard enhancement flags on exit
- Update helper text and status bar colors for better visibility
Add ability to restore a previous session by ID or most-recent from both CLI (--restore/--latest) and TUI (/restore, /latest). Includes LoadTrace agent protocol command, session filtering for empty traces, and trace rendering in the TUI.
Document the workspace crate directory/package name mapping to clarify usage of cargo -p commands.
Enforce consistent formatting and import ordering across the entire codebase.
- improve bash tools behaviour to default to cwd
* benchmark are more complexe, with four evaluation tasks
- limit max tools usage per turn
- avoid running duplicate command
- compact session
- Force batch fix, instead of re-running check at every change
- Add compaction on agent/skills
- support for hash based editing
- support multi write
- auto verification on edit
Add a session picker component for browsing and restoring saved sessions.
Wire it up in the TUI module and update session persistence to support it.
Add location, git branch, and agent mode display to the status bar.
Update command handling and helper references accordingly.
Add AgentMode enum and cycling logic in the TUI input handler.
Enforce plan mode in ClaimManager and update the coder prompt and runner
to support plan mode behavior.
Add import module to import configs from Claude (CLAUDE.md) and
Cursor (.cursorrules/.cursor/rules) into AGENTS.md. Wire up
the import subcommand in the CLI entry point.
Refactor agent loop, builder, and event handling. Update coder and
searcher runners, memory tools, and function-calling client to
align with the new agent architecture.
Add documentation for session picker, status bar fields, plan mode,
config import, and updated architecture notes.
AxelDum added 21 commits October 7, 2026 13:45
- use .json extension so tools can load the correct parser
- rename auth.config to auth.config.json
- rename agent.config to agent.config.json
- support for shortcut configuration in tui.config.json
- deprecate env var shortcuts
- document configuration files
- factor tools declaration
- add mcp manager in tui
- add /tools command to list all registered tools
- add /mcp to show mcp server and their connection status
Break up the App God class into focused, testable components:
- AgentHandler trait for event-driven subsystem communication
- AgentState groups tool_tracker, token_counter, permission_manager,
  session_manager, and mcp_manager behind a single fan-out point
- RenderManager owns history + formatter, implements AgentHandler
- AgentMeta groups agent model/provider/name metadata
- UiState groups modal_state, session_picker, and exit flag
- Extract key handling into key_handler.rs
- Move theme ownership into StatusBar
- Remove dead custom_agent field
Not shown in auto/fc mode, but shown with fc2/so function mode
- cli-clipboard was deprecated
- Add /session (session picker) and /pwd (working directory) commands
- Fix /mcp, /skills, /tools rendering by removing dead clear/insert_before
  calls (no-op for Viewport::Fullscreen) and adding empty-state guards
- Fix /auth black page by dropping terminal before LeaveAlternateScreen
  and removing terminal.clear() that blocked on EventStream mutex
- Fix session/agent picker transparency with Clear widget + background fill
- Fix ? help tab spacing (replaced \t with padded formatting)
- Change /tokens from status bar notification to rendered text block
- Add ◆ system message marker with add_system_text for command outputs
- change ctrl+x to alt+x for preview
- usage.input_tokens_details was merged into prompt_tokens_details
- ChatMessage::Assistant initializers require the new reasoning field

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Multiple correctness and security issues affect session paths, verification, file editing, compaction, and TUI behavior.

18 open findings
What changed in this PR

This release consolidates SHAI 0.2.1, expanding the TUI, agent tooling, session handling, configuration, and documentation while updating workspace crate versions.

Changes:

  • Refactors the TUI with configurable shortcuts, pickers, status rendering, and clipboard/ratatui updates.
  • Adds batched filesystem tools, hash edits, compaction, verification, memory, skills, prompts, and session persistence.
  • Updates HTTP/LLM integrations, release metadata, documentation, and examples.
File Description
SHAI.md Removes legacy guide.
AGENTS.md Adds repository guidance.
.gitignore Ignores benchmark outputs.
Cargo.toml Removes ratatui patch.
shai-macros/​Cargo.toml Bumps crate version.
shai-llm/​Cargo.toml Bumps version and adds tracing.
shai-llm/​src/​lib.rs Reorganizes exports.
shai-llm/​src/​chat.rs Formats chat hooks.
shai-llm/​src/​logging.rs Uses tracing for logs.
shai-llm/​src/​provider.rs Formats provider API.
shai-llm/​src/​tool/​mod.rs Reorders tool exports.
shai-llm/​src/​tool/​tool.rs Cleans tool definitions.
shai-llm/​src/​tool/​call.rs Refactors tool dispatch.
shai-llm/​src/​tool/​call_fc_auto.rs Handles empty toolboxes.
shai-llm/​src/​tool/​call_fc_required.rs Refactors required calls.
shai-llm/​src/​providers/​mod.rs Reorders providers.
shai-llm/​src/​providers/​models.rs Formats model errors.
shai-llm/​src/​providers/​openai.rs Formats OpenAI provider.
shai-llm/​src/​providers/​openai_compatible.rs Formats compatible provider.
shai-llm/​src/​providers/​ollama.rs Formats Ollama provider.
shai-llm/​src/​providers/​ovhcloud.rs Formats OVHcloud provider.
shai-llm/​src/​providers/​openrouter/​mod.rs Cleans export.
shai-llm/​src/​providers/​openrouter/​api.rs Formats conversion API.
shai-llm/​src/​providers/​anthropic/​mod.rs Reorders modules.
shai-llm/​src/​providers/​anthropic/​api.rs Cleans imports.
shai-llm/​src/​examples/​basic_query.rs Formats basic example.
shai-llm/​src/​examples/​query_with_history.rs Formats history example.
shai-llm/​src/​examples/​streaming_query.rs Formats streaming example.
shai-http/​Cargo.toml Bumps crate version.
shai-http/​src/​lib.rs Reorganizes exports.
shai-http/​src/​http.rs Formats server routes.
shai-http/​src/​error.rs Formats error responses.
shai-http/​src/​streaming.rs Formats SSE handling.
shai-http/​src/​session/​mod.rs Uses core persistence.
shai-http/​src/​session/​persist.rs Removes duplicate persistence.
shai-http/​src/​session/​session.rs Formats session handling.
shai-http/​src/​session/​lifecycle.rs Uses shared persistence.
shai-http/​src/​session/​logger.rs Formats event logging.
shai-http/​src/​apis/​mod.rs Reorders APIs.
shai-http/​src/​apis/​simple/​mod.rs Reorders simple API.
shai-http/​src/​apis/​simple/​types.rs Adds enum lint allowances.
shai-http/​src/​apis/​simple/​handler.rs Formats session routing.
shai-http/​src/​apis/​simple/​formatter.rs Formats event API.
shai-http/​src/​apis/​openai/​mod.rs Reorders exports.
shai-http/​src/​apis/​openai/​completion/​mod.rs Reorders modules.
shai-http/​src/​apis/​openai/​completion/​formatter.rs Formats completion output.
shai-http/​src/​apis/​openai/​response/​mod.rs Reorders modules.
shai-http/​src/​apis/​openai/​response/​types.rs Formats response types.
shai-http/​src/​apis/​openai/​response/​formatter.rs Formats response events.
shai-core/​Cargo.toml Adds parser dependencies and version.
shai-core/​src/​lib.rs Exposes sessions and modules.
shai-core/​src/​config/​mod.rs Exposes TUI configuration.
shai-core/​src/​config/​tui.rs Implements shortcut configuration.
shai-core/​src/​session/​mod.rs Exposes persistence.
shai-core/​src/​session/​persist.rs Centralizes saved sessions.
shai-core/​src/​tools/​mod.rs Adds tool factory and modules.
shai-core/​src/​tools/​frontmatter.rs Parses markdown frontmatter.
shai-core/​src/​tools/​prompts/​mod.rs Exposes prompt discovery.
shai-core/​src/​tools/​skills/​mod.rs Exposes skill discovery.
shai-core/​src/​tools/​memory/​mod.rs Exposes memory support.
shai-core/​src/​tools/​memory/​structs.rs Defines memory parameters.
shai-core/​src/​tools/​memory/​memory.rs Implements memory tools.
shai-core/​src/​tools/​todo/​mod.rs Reorders exports.
shai-core/​src/​tools/​todo/​structs.rs Adds storage default.
shai-core/​src/​tools/​todo/​todo.rs Improves todo output.
shai-core/​src/​tools/​bash/​mod.rs Reorders exports.
shai-core/​src/​tools/​bash/​structs.rs Cleans imports.
shai-core/​src/​tools/​bash/​tests.rs Formats tests.
shai-core/​src/​tools/​fetch/​mod.rs Reorders exports.
shai-core/​src/​tools/​fetch/​structs.rs Cleans imports.
shai-core/​src/​tools/​fetch/​fetch.rs Adds default implementation.
shai-core/​src/​tools/​fetch/​tests.rs Cleans formatting.
shai-core/​src/​tools/​mcp/​mod.rs Reorders MCP modules.
shai-core/​src/​tools/​mcp/​mcp.rs Formats MCP abstraction.
shai-core/​src/​tools/​mcp/​mcp_config.rs Formats client factory.
shai-core/​src/​tools/​mcp/​mcp_http.rs Formats HTTP transport.
shai-core/​src/​tools/​mcp/​mcp_oauth.rs Cleans OAuth flow.
shai-core/​src/​tools/​mcp/​mcp_sse.rs Formats SSE transport.
shai-core/​src/​tools/​mcp/​mcp_stdio.rs Formats stdio transport.
shai-core/​src/​tools/​fs/​mod.rs Adds hash, symbols, verification.
shai-core/​src/​tools/​fs/​hash.rs Adds line hashing.
shai-core/​src/​tools/​fs/​verification.rs Adds post-edit verification.
shai-core/​src/​tools/​fs/​symbol/​mod.rs Exposes symbol extraction.
shai-core/​src/​tools/​fs/​read/​mod.rs Exposes batched read types.
shai-core/​src/​tools/​fs/​read/​structs.rs Defines batched reads.
shai-core/​src/​tools/​fs/​read/​read.rs Implements hashed batched reads.
shai-core/​src/​tools/​fs/​write/​mod.rs Exposes batched writes.
shai-core/​src/​tools/​fs/​write/​structs.rs Defines batched writes.
shai-core/​src/​tools/​fs/​write/​tests.rs Tests multi-file writes.
shai-core/​src/​tools/​fs/​edit/​mod.rs Exposes batched edits.
shai-core/​src/​tools/​fs/​edit/​structs.rs Defines hash-based edits.
shai-core/​src/​tools/​fs/​edit/​edit.rs Implements atomic-style edits.
shai-core/​src/​tools/​fs/​find/​mod.rs Reorders exports.
shai-core/​src/​tools/​fs/​find/​structs.rs Formats find types.
shai-core/​src/​tools/​fs/​ls/​mod.rs Reorders exports.
shai-core/​src/​tools/​fs/​ls/​structs.rs Cleans formatting.
shai-core/​src/​tools/​fs/​multiedit/​mod.rs Removes obsolete tool.
shai-core/​src/​tools/​fs/​multiedit/​structs.rs Removes old parameters.
shai-core/​src/​tools/​fs/​multiedit/​tests.rs Removes old tests.
shai-core/​src/​runners/​mod.rs Adds shared test helpers.
shai-core/​src/​runners/​coder/​mod.rs Reorders modules.
shai-core/​src/​runners/​searcher/​mod.rs Reorders modules.
shai-core/​src/​runners/​searcher/​prompt.rs Formats prompt generation.
shai-core/​src/​runners/​searcher/​searcher.rs Updates brain interface.
shai-core/​src/​runners/​gerund/​mod.rs Reorders modules.
shai-core/​src/​runners/​gerund/​prompt.rs Cleans prompt source.
shai-core/​src/​runners/​gerund/​gerund.rs Refactors LLM request.
shai-core/​src/​runners/​clifixer/​mod.rs Reorders modules.
shai-core/​src/​runners/​clifixer/​prompt.rs Formats prompt generation.
shai-core/​src/​runners/​clifixer/​fix.rs Refactors structured response.
shai-core/​src/​runners/​compacter/​mod.rs Exposes compaction layers.
shai-core/​src/​runners/​compacter/​compact.rs Adds tool compaction.
shai-core/​src/​runners/​compacter/​ansi.rs Adds ANSI stripping.
shai-core/​src/​runners/​compacter/​generic.rs Adds generic truncation.
shai-core/​src/​agent/​mod.rs Reorganizes agent exports.
shai-core/​src/​agent/​error.rs Cleans formatting.
shai-core/​src/​agent/​states/​mod.rs Reorders state modules.
shai-core/​src/​agent/​states/​states.rs Adds state display.
shai-core/​src/​agent/​states/​starting.rs Uses shared tool context.
shai-core/​src/​agent/​states/​running.rs Formats state handling.
shai-core/​src/​agent/​states/​processing.rs Runs post-edit verification.
shai-core/​src/​agent/​states/​pause.rs Formats pause handling.
shai-core/​src/​agent/​states/​terminal.rs Simplifies terminal handling.
shai-core/​src/​agent/​output/​mod.rs Reorders output exports.
shai-core/​src/​agent/​output/​stdout.rs Cleans imports.
shai-core/​src/​agent/​output/​log.rs Extends event logging.
shai-core/​examples/​AGENTS.md Adds example agent guidance.
shai-core/​examples/​oauth_test.rs Cleans formatting.
shai-core/​examples/​prompts/​caveman.md Adds concise prompt.
shai-core/​examples/​scripts/​bugfix.json Adds bugfix benchmark.
shai-core/​examples/​scripts/​feature.json Adds feature benchmark.
shai-core/​examples/​scripts/​refactor.json Adds refactor benchmark.
shai-core/​examples/​scripts/​search.json Adds search benchmark.
shai-core/​examples/​skills/​code-review/​SKILL.md Adds review skill example.
shai-core/​examples/​skills/​debugging/​SKILL.md Adds debugging skill.
shai-core/​examples/​skills/​git-workflow/​SKILL.md Adds Git workflow skill.
shai-core/​examples/​skills/​refactoring/​SKILL.md Adds refactoring skill.
shai-core/​examples/​skills/​release/​SKILL.md Adds release skill.
shai-core/​examples/​skills/​rust-lint/​SKILL.md Adds lint skill.
shai-core/​examples/​skills/​testing/​SKILL.md Adds testing skill.
shai-cli/​Cargo.toml Updates TUI dependencies/version.
shai-cli/​src/​fc/​mod.rs Reorders modules.
shai-cli/​src/​headless/​mod.rs Reorders modules.
shai-cli/​src/​shell/​mod.rs Cleans formatting.
shai-cli/​src/​shell/​terminal.rs Cleans terminal handling.
shai-cli/​src/​tui/​mod.rs Exposes new TUI components.
shai-cli/​src/​tui/​agent_meta.rs Tracks agent metadata.
shai-cli/​src/​tui/​auth/​mod.rs Reorders auth modules.
shai-cli/​src/​tui/​auth/​config_providers.rs Refactors provider modal.
shai-cli/​src/​tui/​cmdnav.rs Removes empty navigator.
shai-cli/​src/​tui/​handler.rs Adds event handler trait.
shai-cli/​src/​tui/​helper.rs Generates command/shortcut help.
shai-cli/​src/​tui/​mcp_manager.rs Tracks MCP status.
shai-cli/​src/​tui/​modal.rs Adds alternate-screen modals.
shai-cli/​src/​tui/​perm_manager.rs Queues permission requests.
shai-cli/​src/​tui/​renderer.rs Manages conversation rendering.
shai-cli/​src/​tui/​session_manager.rs Tracks active session.
shai-cli/​src/​tui/​shortcuts.rs Maps configured shortcuts.
shai-cli/​src/​tui/​token_counter.rs Tracks token usage.
shai-cli/​src/​tui/​ui_state.rs Centralizes UI state.
docs/​benchmarks.md Documents benchmark harness.
docs/​configurations/​agents.md Documents agent configuration.
docs/​configurations/​auth.md Documents auth configuration.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shai-core/src/session/persist.rs
Comment thread shai-core/src/tools/fs/edit/edit.rs
Comment thread shai-core/src/tools/fs/verification.rs
Comment thread shai-cli/src/tui/helper.rs
Comment thread shai-cli/src/tui/renderer.rs
Comment thread AGENTS.md
Comment thread docs/configurations/agents.md
Comment thread docs/configurations/auth.md
Comment thread shai-core/examples/AGENTS.md
Comment thread shai-core/examples/skills/release/SKILL.md
@Marlinski

Copy link
Copy Markdown
Collaborator

Great contribution ! thanks :)

@AxelDum
AxelDum merged commit f4107f1 into ovh:main Oct 8, 2026
3 checks passed
IgorOffline pushed a commit to IgorOffline/ovh-shai that referenced this pull request Oct 10, 2026
- docs: fix OVHAI_API_KEY typo to OVH_API_KEY in agents/auth examples
- docs: add shai-http to the release version checklists
- tui: help panel now shows the active shortcut configuration
- tui: render agent errors once instead of twice in history
- config: persist env-derived tui.config.json on first launch
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.

3 participants