v3.4.0
A full-codebase audit fix batch.
Fixed
- Auto-compact death spiral β
_estimate_tokensused the cumulative lifetime input-token sum, so after enough turns auto-compact fired on every message, repeatedly nuking the conversation. Now uses the most recent request's prompt size and resets after compaction. - Command injection in
git_diffβ the auto-approved tool interpolated args into ashell=Truestring (RCE via prompt injection). Now runsgit diffvia argv withshlex, no shell. /teamcrashed withNameErrorβrewas used but never imported at module level.- Unbounded agentic loops β
max_iterationswas defined but never enforced; now capped (default 15, configurable). - API keys world-readable β
~/.kodiqa/settings.jsonnow written with0600perms (dir0700).
Changed
- Non-blocking startup β the model update/discovery check (which ran
ollama pullon every installed model + scraped ollama.com every launch) is throttled to once perupdate_check_interval_hours(default 24) and skippable via--no-update/check_updates: false.
Added
--no-updateCLI flag;check_updates/update_check_interval_hoursconfig options.rufflinting + CI lint step; dead-code/unused-import cleanup.- Regression tests for the git_diff-injection and auto-compact fixes (290 tests total).