mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
fix: resolve not-subscriptable ty diagnostics across codebase
Add TypedDicts for DEFAULT_CONFIG, CLI state dicts (_ModelPickerState, _ApprovalState, _ClarifyState), and OPTIONAL_ENV_VARS so ty can resolve nested dict subscripts. Guard Optional returns before subscripting (toolsets, cron/scheduler, delegate_tool), coerce str|None to str before slicing (gateway/run, run_agent), split ternary for isinstance narrowing (wecom), and suppress discord interaction.data access with ty: ignore.
This commit is contained in:
parent
72e7c0ce34
commit
fb6d37495b
9 changed files with 405 additions and 25 deletions
|
|
@ -3599,7 +3599,7 @@ if DISCORD_AVAILABLE:
|
|||
)
|
||||
return
|
||||
|
||||
provider_slug = interaction.data["values"][0]
|
||||
provider_slug = interaction.data["values"][0] # ty: ignore[not-subscriptable]
|
||||
self._selected_provider = provider_slug
|
||||
provider = next(
|
||||
(p for p in self.providers if p["slug"] == provider_slug), None
|
||||
|
|
@ -3634,7 +3634,7 @@ if DISCORD_AVAILABLE:
|
|||
return
|
||||
|
||||
self.resolved = True
|
||||
model_id = interaction.data["values"][0]
|
||||
model_id = interaction.data["values"][0] # ty: ignore[not-subscriptable]
|
||||
|
||||
try:
|
||||
result_text = await self.on_model_selected(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue