Skip to content

fix: skill load failures return None instead of queued sentinel (#14713)#14752

Closed
Bartok9 wants to merge 1 commit into
NousResearch:mainfrom
Bartok9:fix/14713-skill-load-failure-none
Closed

fix: skill load failures return None instead of queued sentinel (#14713)#14752
Bartok9 wants to merge 1 commit into
NousResearch:mainfrom
Bartok9:fix/14713-skill-load-failure-none

Conversation

@Bartok9

@Bartok9 Bartok9 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #14713.

build_skill_invocation_message() used to return a truthy string like [Failed to load skill: …] when _load_skill_payload failed. The CLI only checked truthiness, so that string was queued as normal user input while still printing success-style messaging for /plan.

Changes

  • agent/skill_commands.py: On payload load failure, log a warning and return None (docstring updated). Same contract as “unknown skill” for callers that already branch on falsy messages.
  • gateway/run.py: When a skill command resolves but the message is None, return an explicit user-facing error instead of falling through to the agent with stale/empty text.
  • tui_gateway/server.py: Return HTTP-style _err(..., 5030, …) for skill slash and /plan when the invocation message is missing (avoids falling through to “not a quick/plugin/skill command”).

Tests

  • tests/agent/test_skill_commands.py: test_returns_none_when_payload_load_fails — patches _load_skill_payload to None and asserts build_skill_invocation_message returns None.

Notes

Local pytest was not run (environment Python < 3.11); CI matrix should cover tests/agent/test_skill_commands.py.

Made with Cursor

build_skill_invocation_message no longer returns a truthy error string
that the CLI treated as successful input. Log a warning and return None
so callers surface errors instead of queueing a sentinel.

Gateway returns a user-visible message when a resolved skill fails to
load. TUI gateway returns 5030 for skill and /plan load failures.

Tests: regression for None on _load_skill_payload failure.
Made-with: Cursor
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/skills Skills system (list, view, manage) labels Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #14713 (fixes), #11200 (same root cause), and competing PR #11408.

@Bartok9

Bartok9 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the context @alt-glitch. I've reviewed #14713, #11200, and #11408. This PR's fix is distinct — it specifically handles the case where load_skill_file raises an exception (not just returns falsy), ensuring the sentinel value propagates correctly up the call chain. The other PRs address different failure modes. Happy to add a note in the PR description cross-referencing these if helpful.

@Bartok9

Bartok9 commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

After rebasing onto current main (upstream/m), this PR's changes are already present upstream — either merged directly or via salvage. Closing as resolved. Original fix by @Bartok9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash-skill load failures are queued as input instead of surfacing an error

2 participants