fix(sdk): address approval interface review findings

This commit is contained in:
fz committed 2026-10-19 13:45:50 +08:00
1 parent 0ff3d1ddd2
commit 50fb069e7e
19 files changed
+52 -37

No files matched your search

+1 -1
View File
@@ -76,7 +76,7 @@ with HarnessClient(HarnessConfig(dsh_home="/absolute/path/to/dsh-home")) as clie
print(question.toolName, question.reason)
client.respond(request.id, {"outcome": "rejected"})
else:
client.respond_error(request.id, -32601, "Unsupported client request")
client.respond_error(request.id, code=-32601, message="Unsupported client request")
```
## Customize plugins
+1 -1
View File
@@ -76,7 +76,7 @@ with HarnessClient(HarnessConfig(dsh_home="/absolute/path/to/dsh-home")) as clie
print(question.toolName, question.reason)
client.respond(request.id, {"outcome": "rejected"})
else:
client.respond_error(request.id, -32601, "Unsupported client request")
client.respond_error(request.id, code=-32601, message="Unsupported client request")
```
## 自定义插件
+1 -1
View File
@@ -23,7 +23,7 @@ def test_python_approval_controls_runtime_operation(tmp_path: Path, outcome: str
binary = repo / "apps/cli/lib/bin.js"
if node is None or not binary.exists():
pytest.skip("requires Node and built dsh CLI")
fixture = repo / "apps/cli/tests/profiles/sdk/fixtures/approval.mjs"
fixture = repo / "packages/sdk/server/tests/fixtures/approval.mjs"
marker = tmp_path / "approved.txt"
patch = tmp_path / "approval.patch.yml"
patch.write_text("- insert:\n - id: approval-fixture\n name: " + json.dumps(str(fixture))