fix(hermes): enable model and reasoning controls - #5001
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| session_id, | ||
| voice_channel_snapshot, | ||
| ) | ||
| if had_reasoning_config: |
There was a problem hiding this comment.
🟠 High hermes-t3-gateway/adapter.py:1529
restore_prior_memory_configuration unconditionally writes the entire runner-wide runner._reasoning_config from this turn's snapshot on rollback. When another thread's turn successfully changes _reasoning_config while this transaction is suspended (at an await dispatch(...)), a subsequent failure in this turn overwrites that concurrent update with a stale snapshot, silently rolling back another session's reasoning configuration. Consider serializing restoration with configuration dispatch or limiting rollback to session-scoped state.
🤖 Copy this AI Prompt to have your agent fix this:
In file @integrations/hermes-t3-gateway/adapter.py around line 1529:
`restore_prior_memory_configuration` unconditionally writes the entire runner-wide `runner._reasoning_config` from this turn's snapshot on rollback. When another thread's turn successfully changes `_reasoning_config` while this transaction is suspended (at an `await dispatch(...)`), a subsequent failure in this turn overwrites that concurrent update with a stale snapshot, silently rolling back another session's reasoning configuration. Consider serializing restoration with configuration dispatch or limiting rollback to session-scoped state.
This is a stacked follow-up to #4678. It targets
experiment/hermes-provider-ui, notmain, so the work can be reviewed or folded into the existing Hermes PR without creating a competing implementation.What Changed
turn.started.Why
#4678 establishes the Hermes gateway and agent UX, but the connected instance is still exposed as one opaque
hermesmodel and the bound composer cannot change model or reasoning. Hermes already has authenticated model inventory and session-scoped/modeland/reasoningsurfaces, so T3 can expose those choices without owning provider credentials or bypassing Hermes's runtime resolution.The transaction and lifecycle guards are necessary because a rejected turn must not leave a persisted half-switch behind, and a reconnect/rebuild must not erase a valid catalog or allow an old driver stream to overwrite its replacement.
UI Changes
Screenshots are still pending while this PR is in draft.
Verification
git diff --checkpassed.Checklist
Note
Enable per-session model and reasoning controls in the Hermes gateway adapter
models.list.request/models.list.responsemessages and optionalmodelSelection/reasoningEffortfields onturn.startandturn.started.HermesAdapternow applies model and reasoning selections only at fresh turn boundaries via Hermes session-scoped/modeland/reasoningcommands, verifies Hermes acknowledges the applied selections inturn.started, and compensates withturn.interruptif they don't match.HermesDriverperforms asynchronous, generation-scoped model catalog discovery without blocking snapshot reads;requiresNewThreadForModelChangeis nowfalse.ProviderRegistry.mergeProviderModelsretains the previous Hermes model catalog across pending or exhausted discovery snapshots, replacing it only on a completed catalog response.sessionModelSwitchcapability changes from"unsupported"to"in-session"for all Hermes sessions; clients that inspect this field will see changed behavior.📊 Macroscope summarized a5c57be. 13 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.