v0.2.0
v0.2.0 — Token Hardening, Stability, and Release Pipeline
This release focuses on reducing token waste, improving long-session stability, hardening file/tool behavior, and preparing the project for a cleaner release workflow.
Highlights
- Major token-efficiency improvements for tool results, file attachments, validation history, and session saves.
- Smarter and safer
read_filebehavior with caps, query excerpts, and binary/minified file guards. - More robust OpenAI client behavior with timeout, retries, and clearer gateway error messages.
- Better session persistence with fallback titles and local compaction.
- CI, release scripts, expanded tests, and updated documentation.
Token & Context Efficiency
- Added stale tool-result eviction and summarization to avoid resending large tool outputs forever.
- Added per-tool-result cap with actionable hints for continuing via
offset/limitor narrower queries. - Added deduplication for repeated
read_filecalls on the same path/offset/limit. - Added active cleanup for inline
@fileattachments after processing. - Kept only the latest automatic validation failure in active/saved history.
- Added local serialization compaction for saved sessions.
- Added local
/compactfallback that mutates active history when LLM compaction fails. - Added
max_tokensto main completion requests. - Added input/output token tracking and cost estimate in
/usage.
Tool Improvements
- Reduced
read_filedefault cap to 500 lines / 30KB. - Added
read_file.queryfor targeted excerpts around matching lines. - Added binary/non-text detection for
read_file. - Added minified/generated-file guard for default
read_filereads. - Added
list_dircap at 500 entries. - Updated
grep_searchoutput to prefer relative paths. - Added tests for
read_filecaps, query excerpts, binary/minified guards,list_dir, andgrep_search.
Stability & UX
- Added streaming fallback flush for long paragraphs without blank lines.
- Added OpenAI client timeout and retry settings.
- Added clearer timeout/gateway error messages.
- Added synchronous fallback session title before background LLM title generation.
- Improved session save hardening with sanitized history.
- Added non-TTY CLI tests for
--helpand--version.
Docs & Release Workflow
- Added GitHub Actions CI for build, test, and lint.
- Added
release:checkandpreversionscripts. - Updated README/DOCS for session paths, tool behavior, Windows best-effort notes, and quality gates.
- Published package metadata now uses normalized bin path:
aina -> bin/aina.js.
Validation
Validated before release with:
npm run release:check
npm pack --dry-run
Release check includes:
npm run build
npm test
npm run lint
### Published Package
- npm: ainacode@0.2.0
- CLI binary: aina
- Git tag: v0.2.0
### Notes
- Windows support is documented as best-effort until full native Windows TTY/ANSI testing is completed.
- Prompt caching remains deferred until gateway support for caching semantics is confirmed.
- Final-answer tool-schema suppression remains partial by design because the current loop does not add an extra final synthesis API call.