mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 16:23:17 +08:00
Cap run_command spam and force a usable finalize after tool-round limits.
Budget shell calls like CLI, and when rounds are exhausted inject a no-more-tools system nudge plus any user_facing_hint constraints into the final synthesis pass. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
28a5f2586c
commit
9d447b1c51
5 changed files with 186 additions and 27 deletions
|
|
@ -42,6 +42,21 @@ def test_enrich_mcp_scope_sql() -> None:
|
|||
assert "ume_alarm_xlsx_report" in out["fallback_tools"]
|
||||
|
||||
|
||||
def test_build_finalize_system_suffix() -> None:
|
||||
from runtime.tools.tool_error_hints import build_finalize_system_suffix
|
||||
|
||||
en = build_finalize_system_suffix(
|
||||
lang="en",
|
||||
hit_tool_round_limit=True,
|
||||
user_facing_hints=["SQL query is not enabled for this bot token."],
|
||||
)
|
||||
assert "Tool-round limit" in en
|
||||
assert "SQL query is not enabled" in en
|
||||
assert "do NOT call" in en
|
||||
zh = build_finalize_system_suffix(lang="zh", hit_tool_round_limit=True)
|
||||
assert "工具轮次" in zh
|
||||
|
||||
|
||||
def test_enrich_exec_auth() -> None:
|
||||
from runtime.tools.tool_error_hints import enrich_exec_managed_ne_error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue