The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(gateway): stop truncating the command block on a bare / browse
chelsealonga0ef9f747748
diff --git a/tests/tui_gateway/test_slash_fuzzy.py b/tests/tui_gateway/test_slash_fuzzy.pyindex 9cfe023c95d..bdd5e8f684b 100644--- a/tests/tui_gateway/test_slash_fuzzy.py+++ b/tests/tui_gateway/test_slash_fuzzy.py@@ -93,6 +93,34 @@ def test_rank_slash_completions_uses_score_before_usage():assert [item["text"] for item in ranked_plain] == ["/notes", "/summarize"]+def test_rank_slash_completions_does_not_truncate_commands_when_browsing():+ # A bare `/` must surface every registry command (issue: /goal, /loop,+ # /queue sat past position 30 and never reached the client) while the+ # user-growable skill block keeps its cap.+ commands = [_item(f"/cmd{i}") for i in range(40)]++ ranked = _rank_slash_completions(+ commands,+ lambda _name: 0,+ lambda _name: "user",+ browsing=True,+ )+ assert len(ranked) == 40+ assert ranked[-1]["text"] == "/cmd39"+++def test_rank_slash_completions_still_caps_commands_when_searching():+ commands = [_item(f"/cmd{i}") for i in range(40)]++ ranked = _rank_slash_completions(+ commands,+ lambda _name: 0,+ lambda _name: "user",+ browsing=False,+ )+ assert len(ranked) == 30++def test_rank_slash_completions_ties_break_on_usage_then_name():a = _item("/beta", kind="skill")b = _item("/alpha", kind="skill")diff --git a/tui_gateway/server.py b/tui_gateway/server.pyindex 77aa5a0e122..1969bb9aee9 100644--- a/tui_gateway/server.py+++ b/tui_gateway/server.py@@ -3434,7 +3434,10 @@ def _rank_slash_completions(items: list[dict], usage, origin_of, *, browsing: boskills = [item for item in skills if origin_of(name_of(item)) != "bundled" or usage(name_of(item)) > 0]skills.sort(key=lambda item: (*(() if score_of is None else (score_of(item),)), -usage(name_of(item)), name_of(item)))- return commands[:_SLASH_COMPLETION_LIMIT] + skills[:_SLASH_COMPLETION_LIMIT]+ # Commands come from the bounded, curated registry (~150 entries), not from user-installed skills, which is+ # what the cap exists to bound. Truncating the command block hid /goal, /loop and /queue from a bare `/`.+ ranked_commands = commands if browsing else commands[:_SLASH_COMPLETION_LIMIT]+ return ranked_commands + skills[:_SLASH_COMPLETION_LIMIT]# argv shapes that must not run headless in the gateway process → user hint.