Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion agent/prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,13 @@ def _strip_yaml_frontmatter(content: str) -> str:
),
"cli": (
"You are a CLI AI Agent. Try not to use markdown but simple text "
"renderable inside a terminal."
"renderable inside a terminal. "
"File delivery: there is no attachment channel — the user reads your "
"response directly in their terminal. Do NOT emit MEDIA:/path tags "
"(those are only intercepted on messaging platforms like Telegram, "
"Discord, Slack, etc.; on the CLI they render as literal text). "
"When referring to a file you created or changed, just state its "
"absolute path in plain text; the user can open it from there."
),
"sms": (
"You are communicating via SMS. Keep responses concise and use plain text "
Expand Down
17 changes: 17 additions & 0 deletions hermes_cli/model_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,23 @@ def normalize_model_for_provider(model_input: str, target_provider: str) -> str:
return bare
return _normalize_for_deepseek(bare)

# --- Kimi / Moonshot: map auto-discovered short IDs (k2p6) to API-accepted
# canonical names (kimi-k2.6). The /models endpoint returns internal
# short forms that fail at request time without this repair (issue #13758).
if provider in {"kimi-coding", "kimi-coding-cn", "moonshot"}:
bare = _strip_matching_provider_prefix(name, provider)
if "/" in bare:
bare = bare.split("/", 1)[1]
# k2p6 -> kimi-k2.6, k2p5 -> kimi-k2.5, etc.
_kimi_short_map = {
"k2p6": "kimi-k2.6",
"k2p5": "kimi-k2.5",
"k2p8": "kimi-k2.8",
}
if bare.lower() in _kimi_short_map:
return _kimi_short_map[bare.lower()]
return bare

# --- Direct providers: repair matching provider prefixes only ---
if provider in _MATCHING_PREFIX_STRIP_PROVIDERS:
return _strip_matching_provider_prefix(name, provider)
Expand Down
10 changes: 9 additions & 1 deletion hermes_cli/tools_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,20 @@ def _get_effective_configurable_toolsets():

Plugin toolsets are appended at the end so they appear after the
built-in toolsets in the TUI checklist.
Duplicate keys (plugin toolsets whose key already exists in
CONFIGURABLE_TOOLSETS) are skipped so the built-in row is kept —
plugin-added tools are extensions of that toolset, not a second
top-level row (issue #13640).
"""
result = list(CONFIGURABLE_TOOLSETS)
built_in_keys = {ts_key for ts_key, _, _ in CONFIGURABLE_TOOLSETS}
try:
from hermes_cli.plugins import discover_plugins, get_plugin_toolsets
discover_plugins() # idempotent — ensures plugins are loaded
result.extend(get_plugin_toolsets())
plugin_toolsets = get_plugin_toolsets()
# Skip plugin toolsets whose key already exists in built-ins
plugin_toolsets = [(k, l, d) for k, l, d in plugin_toolsets if k not in built_in_keys]
result.extend(plugin_toolsets)
except Exception:
pass
return result
Expand Down
18 changes: 18 additions & 0 deletions tests/agent/test_prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,24 @@ def test_platform_hints_known_platforms(self):
assert "cron" in PLATFORM_HINTS
assert "cli" in PLATFORM_HINTS

def test_cli_hint_does_not_suggest_media_tags(self):
# Regression: MEDIA:/path tags are intercepted only by messaging
# gateway platforms. On the CLI they render as literal text and
# confuse users. The CLI hint must steer the agent away from them.
cli_hint = PLATFORM_HINTS["cli"]
assert "MEDIA:" in cli_hint, (
"CLI hint should mention MEDIA: in order to tell the agent "
"NOT to use it (negative guidance)."
)
# Must contain explicit "don't" language near the MEDIA reference.
assert any(
marker in cli_hint.lower()
for marker in ("do not emit media", "not intercepted", "do not", "don't")
), "CLI hint should explicitly discourage MEDIA: tags."
# Messaging hints should still advertise MEDIA: positively (sanity
# check that this test is calibrated correctly).
assert "include MEDIA:" in PLATFORM_HINTS["telegram"]


# =========================================================================
# Environment hints
Expand Down
5 changes: 4 additions & 1 deletion ui-tui/src/components/appChrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ export function StatusRule({
) : (
<Text color={statusColor}>{status}</Text>
)}
<Text color={t.color.dim}> │ {model}</Text>
<Text color={t.color.dim}> │ </Text>
<Text color={t.color.dim} wrap="truncate-end" width={18}>
{model}
</Text>
{ctxLabel ? <Text color={t.color.dim}> │ {ctxLabel}</Text> : null}
{bar ? (
<Text color={t.color.dim}>
Expand Down