Skip to content

fix(gateway): NameError on skill slash commands — wrong variable reference#1697

Merged
teknium1 merged 1 commit intomainfrom
fix/gateway-skill-command-nameref
Mar 17, 2026
Merged

fix(gateway): NameError on skill slash commands — wrong variable reference#1697
teknium1 merged 1 commit intomainfrom
fix/gateway-skill-command-nameref

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Skill slash commands in the gateway (e.g. /deploy, any user-defined skill command) always silently fail with a NameError.

Root cause: Line 1482 of gateway/run.py passes session_key as task_id to build_skill_invocation_message(), but session_key is not defined until line 1519. The try/except Exception block on line 1487 silently swallows the error, so the skill content is never injected and the message falls through to normal processing.

Fix: Replace session_key with _quick_key, which is the session key variable defined at line 1292 — the same variable used by the /plan handler on line 1379.

What changed

  • gateway/run.py: One-line fix — task_id=session_keytask_id=_quick_key

Test plan

  • Send a skill slash command (e.g. /plan write a hello world) via Telegram/Discord
  • Verify the skill content is injected and the agent receives it
  • Previously: skill commands silently fell through to normal chat
Line 1482 referenced 'session_key' which is not defined until line 1519,
causing a NameError on every skill slash command invocation in the gateway
(e.g. /deploy, /plan-with-skill). The try/except silently swallowed the
error, making all user-defined skill slash commands silently fail.

The correct variable is '_quick_key', defined at line 1292 (same variable
used by the /plan handler on line 1379).
@teknium1 teknium1 merged commit ea23872 into main Mar 17, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant