Fix provider, tool safety, i18n, and cloud stability issues#97
Merged
Conversation
Fix context compaction so tool_use/tool_result round trips are not split across summarized and preserved messages. Track background agent asyncio tasks in TaskManager so /tasks stop and task_stop cancel running coroutines, consume background task exceptions, and avoid shared event_queue state on concurrency-safe AgentTool calls. Fixes #82. Fixes #90.
Fix issue #80 by adding a shared atomic text writer, using it for YAML config and input history saves, preserving truncated session JSON escapes, and disabling lexicographic comparison for invalid update versions.
Fixes #92, #84, #85, and the approved medium scope of #76.\n\n- Cache shell history suggestions by history file identity and cap results.\n- Fix /model custom apiBase detection and preserve custom apiBase on model switch.\n- Improve /status compact token formatting.\n- Use gettext ngettext for resume picker plurals and update catalogs.\n- Include tool definitions in context usage and add model-family token estimate fallbacks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a batch of agent runtime, provider streaming, tool safety, cloud deployment, persistence, UI/i18n, and documentation issues reported across GitHub issues #67, #68, #76, #77, #78, #80, #81, #82, #83, #84, #85, #87, #88, #89, #90, and #92.
It also rebases the branch onto the latest
origin/main, resolves translation conflicts, runsmake translate, and keeps generated translation artifacts (messages.pot,messages.mo) and rootdocs/files out of the final branch diff while leaving them available locally.Fixed Issues
Fixes #67 - Provider streaming fallback, watchdog, and qwenpaw shutdown safety
ProviderManagerstate.__anext__()calls with an idle timeout so half-open or stalled streams can fall back instead of hanging forever.sys.exit(1)inside the async generator into a provider configuration error that is surfaced as a non-retryable stream error event.Fixes #68 - Skill renderer shell execution injection after parameter substitution
$ARGUMENTSor named parameters from injecting new shell execution blocks that bypass the original permission check.Fixes #76 -
/statuscontext token estimation excludes tools and undercounts non-OpenAI modelsContextManagerand synchronized tool definitions fromAgentLoopwhenever the registry/provider changes.cl100k_baseis a poor proxy./statusand context manager tests so context usage includes tool schemas and no longer significantly underestimates API input tokens.Fixes #77 - ROS stack status, telemetry, and async blocking behavior
is_success.Fixes #78 - Bash readonly classification: broad pip matching and duplicated sed detection
pip,pip3, and versioned pip executables match, while unrelated commands such aspipx,pip-audit, andpipeline-*do not inherit pip readonly behavior.Fixes #80 - Atomic writes and incorrect decoding/version comparison
Falseinstead of lexicographic ordering, preventing bogus update decisions such as9.0.0-local > 10.0.0-local.Fixes #81 - Aliyun credential robustness and OAuth HTTP client lifecycle
namefield.Fixes #82 - Context compaction splits tool-use round trips
preserve_recent_turns * 2.tool_useblocks from their matchingtool_resultmessages.Fixes #83 - Tool interface and fallback correctness issues
executeparameters.src/**/*.pybehaves consistently withrg --glob.list_filesskip entries that cannot be statted, including broken symlinks, instead of failing the entire directory listing.Fixes #84 - UI/status display and shell history performance
/modelcustom base URL telemetry by readingapiBasefrom the active provider config instead of treatingactiveProvideras a dict.Fixes #85 - i18n pluralization uses English suffix rules
ngettextsupport in the i18n layer and replaced hardcoded English plural suffix formatting in resume picker UI with gettext plural forms.make translate.Fixes #87 - Read-only tools auto-approve sensitive file reads
cat,grep,head, and related file-reading commands.Fixes #88 - Readonly whitelist commands allow dangerous exec/delete arguments
find/fdexec/delete flags, GNU sed shell execution, ripgrep--pre, sort--compress-program, and related unsafe forms.find,fd,sed,rg, andsortinvocations across permission and readonly classification paths.Fixes #89 -
read_fileandweb_fetchread full content before truncationresponse.text.Fixes #90 - AgentTool background task lifecycle and event queue cross-talk
Fixes #92 - ShellHistoryProvider rereads full history on each keystroke
Additional Notes
website/docsand all website i18n copies.docs/planning files,src/iac_code/i18n/messages.pot, and compiledmessages.mofiles out of git tracking; they remain generated/ignored artifacts.origin/mainand reviewed compatibility with new main changes in update checking, provider robustness, and agent stream termination.Test Plan
PATH=/Users/ehzyo/.local/bin:$PATH make translatePATH=/Users/ehzyo/.local/bin:$PATH make lintPATH=/Users/ehzyo/.local/bin:$PATH make test(4454 passed, 244 warnings)agent_loop,update_checker, OpenAI/OpenRouter provider changes, andProviderManagerfallback behavior