Repository navigation
Add OpenClaw harness mapping and recorded cases (#1126) - #1185
SijanBhandari17 wants to merge 14 commits into
Conversation
Maps OpenClaw's built-in tools to Tracekit's, with cases recorded on OpenClaw 2026.11.10 (6ea542f). The plugin generator, installer, docs and policy pack follow after review. Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
Thanks, @SijanBhandari17. The mapping follows the Devin and Kiro patterns, and blocking a call that names no path, URL or command is the right default. CI is set to run; I'll post a full review once it has. |
|
@SijanBhandari17 CI ran: the failures I read all come from one gap.
Add OpenClaw's entry: the path OpenClaw reads its hooks from, in a project and in the home folder, with a comment saying where that comes from (as the Copilot and Kiro entries do). Then those tests should pass. I'll do the full review once CI is green. |
Cygnux-Labs#1126) config_path points at ~/.openclaw/extensions/tracekit/index.js (OpenClaw has no project scope); install writes the plugin folder (index.js with the marker, manifest, package.json) and refuses a folder that isn't Tracekit's; doctor warns when plugins.entries.tracekit.hooks.timeouts.before_tool_call is under the approval wait. Enabling the plugin and setting that timeout come next. Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
…-Labs#1126) The wrapper carries its JavaScript as a command and no pack named it, so the laptop policy held every OpenClaw tool call as an unmapped tool given a command (TK-A062). It reaches nothing without a tool call of its own, each of which is decided as it comes. Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
…in (Cygnux-Labs#1126) A held call's hook waits for its approval only when TRACEKIT_APPROVAL_WAIT is set, which the plugin did not do, so a held call was blocked at once. Tested with the hook run directly: it holds, waits, and exits 0 once approved. Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
…ygnux-Labs#1126) TK-F009 and TK-F015 now hold writes to ~/.openclaw/extensions/ and openclaw.json, not its workspace. docs/coding-agents.md gains an OpenClaw section and docs/limits.md the rows for what was recorded on 2026.11.10: Code Mode's call budget and the node executor, /new, optional results, and the tools not recorded. Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
…nux-Labs#1126) Writes and deletes of ~/.openclaw/extensions/ and openclaw.json are held in every pack and engine; the workspace, reads and near names are not. Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
@SijanBhandari17 Thanks: |
|
@SijanBhandari17 CI ran on
Also, a heads-up on direction: a change to the policy packs is in progress. Most rules will record and label a call instead of holding it, and only a short list of irreversible actions will still be held. Your tool mappings aren't affected by that, but expect one more merge of main before this lands. Thanks for the work on this. |
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
@SijanBhandari17 Thanks for the quick push. CI on |
|
@SijanBhandari17 Thanks, the docs table and the installer test are green now. One left: Offline evals still fails, now on |
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
@SijanBhandari17 Thanks, CI on |
|
@SijanBhandari17 CI is all green on |
|
I've marked it ready for review. |
|
@SijanBhandari17 Thanks. The review of the final head and the sealed test run have both started; I'll post what they find here. |
|
@SijanBhandari17 Thanks for the work here. The plugin itself is solid. It never fails open: it blocks on a spawn error, a non-zero exit, a signal or the timeout. It blocks only the tool call, never OpenClaw. The approval wait sits inside the kill, and the installer refuses a folder that isn't Tracekit's and backs up what it replaces. E17 and E21 didn't move. These need fixing before it merges, because each lets a call go through unread or unrecorded:
Fine as a follow-up PR, after the pack changes in #604 land (they touch the same files):
Ask here if any of these doesn't match what you saw in OpenClaw 2026.11.10. A couple depend on how OpenClaw itself behaves, and your recordings are the ground truth. |
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
@SijanBhandari17 Thanks. CI on this commit is waiting for a maintainer's approval; once it has run, I'll check each point of the review against the change and run the tests in our sealed container. |
|
@SijanBhandari17 Thanks. I checked the five points against
Its tests pass in our sealed container: the agent hooks, harness hooks, install files, signer policy, doctor and docs files, with no failures. Before it merges, I need you to confirm two of these on a real OpenClaw 2026.11.10 Gateway. Both fail closed when OpenClaw doesn't send what the plugin reads, which is safe, but it would block every Code Mode call or every plain
Could you post what the hook receives on that Gateway (redacted), for one Code Mode call, one plain Three small things too:
|
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
Thanks for the review. I ran the updated plugin on a real OpenClaw 2026.11.10 (6ea542f) Gateway on Linux, using a scripted local model.
Relevant fields from the three Tracekit pre-tool payloads: [
{
"tool_name": "exec",
"cwd": "/w",
"tool_input": {"command": "pwd"}
},
{
"tool_name": "write",
"cwd": "/w",
"tool_input": {
"path": "review-smoke.txt",
"content": "Tracekit review smoke.\n"
}
},
{
"tool_name": "exec",
"tool_kind": "code_mode_exec",
"cwd": "/w",
"tool_input": {
"code": "return await read({path: \"review-smoke.txt\"});",
"title": "Read the smoke note"
}
}
]All three pre-tool hooks exited 0 and all three calls reached the Gateway’s after hook without a reported error. I also restored the original recording byte for byte, put the synthetic |
|
@SijanBhandari17 Thanks, that settles both: the Gateway sends |
|
@SijanBhandari17 The one red job isn't your change: the offline evals' latency gate (the dev pack on the fallback regex engine at 15.16x the reference, against a 15x line) is at its edge on every PR today, and we're fixing that on our side. I've re-run it. |
|
@SijanBhandari17 The re-run gave the same: the dev pack on the fallback regex engine at 15.09x the reference against a 15x line, with the other five pairs at 12-14x. That pack was already at the line on main, and this PR's new rules tip it over every time, so a re-run won't help; it isn't something to change in your PR. We're speeding that path up now; once that lands on main, merge |
|
@SijanBhandari17 An update on the latency gate: no quick win in rule matching (an index made the slowest calls slower), so we're speeding up the shell parse every decision pays for, with every decision checked identical. It'll take a little longer; the PR is otherwise ready, so nothing to do on your side meanwhile. |
|
@LoopGlitch26, thank you for the update. |
|
@SijanBhandari17 Good news on the red speed job: #1231 replaced that gate on main. CI no longer measures the policy decision against a fixed multiple of a reference job, which moved with the runner. It now compares it with main's own speed on the same machine, so a change that doesn't touch the policy engine passes. Please merge |
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
@SijanBhandari17 Thanks for merging main. CI on |
|
@SijanBhandari17 Thanks. We reviewed
Before merge, three things make the record wrong:
Also needed: Small:
|
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
Thanks @SijanBhandari17. We are reviewing |
|
@SijanBhandari17 Thanks.
Before merge, the hook still reads some paths differently from OpenClaw, so a call OpenClaw runs on a protected file is decided as another file (we read OpenClaw's 2026.11.10 source for each):
Smaller:
CI hasn't run on this head yet (it needs a maintainer's approval); it will once these are in. |
Signed-off-by: Sijan Bhandari <uhisijan@gmail.com>
|
Thanks @SijanBhandari17. We are reviewing |
What and why
Adds experimental OpenClaw support to Tracekit so tool calls can be decided before they run and their outcomes can be recorded. Related to #1126.
sessionIdfor the run andtoolCallIdto pair calls with results.tests/data/harness/openclaw.json, based on captured events and observed argument shapes.tracekit init,doctor, anduninstall. The plugin blocks a pre-tool call if the Tracekit hook cannot start or exits nonzero. A post-tool hook failure is reported without blocking.code_modeand decides each inner tool call separately. Mapsprocesssend-keysandsubmitto typed Bash calls so the v2 policy can hold them for approval.TK-F009andTK-F015, documents setup and limits, and refreshes the E17 and E21 results.How I ran it as a user
I recorded
before_tool_callandafter_tool_callevents from a live OpenClaw 2026.11.10 (6ea542f) Gateway on Linux with Node 24.22.3, using a recorder plugin.I verified the generated Tracekit plugin’s install, discovery, and removal in a temporary home:
Init created
index.js,openclaw.plugin.json, andpackage.json. Doctor found the plugin and reported the default 15-second hook timeout. Uninstall removed the plugin. I also ran the v2 hook directly and confirmed a held call exited successfully after approval.Current limits and review points
terminalactions do not yet get an action-specific hold. The v1 hook does not apply v2’stypedapproval behavior.tracekit last.Checks run
55b88bb4.Checklist
make checkrun locally (GitHub CI and the focused checks above passed).Security invariants
Evidence format