feat: per-thread /model, fallback notifications, subagent model in progress#3984
Closed
web3blind wants to merge 2 commits into
Closed
feat: per-thread /model, fallback notifications, subagent model in progress#3984web3blind wants to merge 2 commits into
web3blind wants to merge 2 commits into
Conversation
…ogress
- gateway/run.py: per-session-key model overrides (_session_model_overrides)
so /model works independently per DM topic thread; /model reset to revert
- gateway/run.py: patch_last progress queue event to append model to
delegate_task progress line
- run_agent.py: fire status_callback('fallback_activated') when primary model
fails and fallback activates, so gateway can notify the user in chat
- tools/delegate_tool.py: send _delegate_model progress event after children
are built, so gateway edits the delegate_task line to include model name
- gateway/platforms/telegram.py: merge conflict resolved (prefer upstream)
|
Neat! |
This was referenced Mar 31, 2026
- register /model in central command registry\n- restore CLI and gateway /model handlers\n- add regression tests for registry, dispatch, and shared model switch pipeline
Contributor
Author
|
Closing this old broad branch as superseded/stale. Several pieces it tried to add now exist on If any specific missing behavior is still needed, it should be resubmitted as a small focused PR rather than reviving this large mixed branch. |
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
Three UX improvements for Telegram DM topics and subagent visibility.
1. Per-thread
/modelcommand (gateway/run.py)Previously
/modelchanged the global config, affecting all DM topic threads simultaneously.Now each thread gets its own model override stored in
_session_model_overrides./model claude-opus-4-6in thread A applies only to thread A/model resetor/model defaultreverts to the global config default2. Fallback model notifications (
run_agent.py)When the primary model fails and
_try_activate_fallback()switches to the backup,the user now receives a chat message via
status_callback:When the session resets and a fresh agent is created, a cleared message is sent:
3. Model name in subagent progress line (
tools/delegate_tool.py,gateway/run.py)Previously the delegate progress showed:
Now it shows:
Implementation:
delegate_toolfires a_delegate_modelprogress event after resolvingcredentials;
gateway/run.pyhandles it by patching the last progress line in-placevia a new
__patch_last__queue message type (edits the existing Telegram message ratherthan sending a second one).
Testing
Tested manually via Telegram DM topics:
/modelper-thread isolation confirmed: changing model in one topic does not affect others