mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 14:30:45 +08:00
Add one-shot UME alarm Excel delivery for WhatsApp ops.
Collapse query+xlsx+deliverable into ume_alarm_xlsx_report, allow write_xlsx(deliverable=true), and accept run_command aliases to cut multi-tool loops. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
aff11c1eae
commit
e03c90fb35
10 changed files with 564 additions and 27 deletions
26
tests/test_run_command_aliases.py
Normal file
26
tests/test_run_command_aliases.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from runtime.tools.public.run_command_tool import run_command_tool
|
||||
from runtime.tools.tool_validation import filter_arguments_to_schema, validate_tool_arguments
|
||||
|
||||
|
||||
def test_run_command_accepts_cmd_alias(monkeypatch) -> None:
|
||||
calls: list[dict] = []
|
||||
|
||||
class _Adapter:
|
||||
def run_command(self, *, command: str, cwd=None, timeout: int = 300):
|
||||
calls.append({"command": command, "cwd": cwd, "timeout": timeout})
|
||||
return {"ok": True, "stdout": "hi", "stderr": "", "exit_code": 0}
|
||||
|
||||
monkeypatch.setattr(
|
||||
"runtime.tools.public.run_command_tool.get_local_adapter",
|
||||
lambda: _Adapter(),
|
||||
)
|
||||
spec = run_command_tool()
|
||||
args = {"cmd": "echo hi", "timeout": 10}
|
||||
filtered = filter_arguments_to_schema(spec.parameters, args)
|
||||
ok, err = validate_tool_arguments(spec.parameters, filtered)
|
||||
assert ok, err
|
||||
out = spec.handler(filtered)
|
||||
assert out.get("ok") is True
|
||||
assert calls[0]["command"] == "echo hi"
|
||||
Loading…
Add table
Add a link
Reference in a new issue