Give a coder session a shell Asked for its working directory, the session started a child coding agent on a hosted model to run `pwd`, waited for it, and reported the answer second-hand. That is minutes and real money for one line of output, and it was the only way to look at anything: reading a file, listing a directory, running the tests, all of it through a whole agent or through the reader. The `shell` tool runs a command here instead. Both streams come back in the order they arrived, because the error output is usually the part worth reading and separating them loses which line came before which. A failing command reports its exit code, since an empty failure reads as an empty success. There is no terminal, so a command that would prompt gets end-of-file and stops rather than waiting where nobody can see it. No login shell either: rc files are slow, and a command whose behaviour depends on an interactive profile will not reproduce. `delegate` goes back to what it is for. A fan-out is worth an agent each; `pwd` is worth a process. The refusal list is short and aimed only at what cannot be undone: erasing a root or a home, reformatting, writing over a raw device, halting the machine, a fork bomb. It is not a security boundary and cannot be one -- a command can be assembled from variables, decoded, or written to a file and run, and no list of patterns sees that. It catches the accident, not the intent, and the comment at the top of the module says so rather than implying more. What decides is the target, not the verb. `rm -rf` on a build directory is ordinary work and is allowed; on `/` or `~` it is refused, because nobody means it. A list that stopped `rm -rf node_modules` would be switched off within a day, so the tests fix both halves: thirteen commands that must be refused and eight ordinary ones that must not be. This also caught a sentence that had gone false. The system message told the model it had "no file, shell, search, or web tools of your own" -- true when it was written, and wrong the moment this landed. It now states the tool list as closed rather than naming what is absent, because what is absent changes and a message that must be edited when the tool list changes is one that will be wrong in between. 376 tests pass, thirty new.
Give a coder session a shell
Deploy story
What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.
Not deployed through the forge lane
No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.
Changed files
-
modified
docs/assure-repo/false-green-candidates.v1.json -
modified
docs/assure-repo/surface-inventory.v1.json -
modified
packages/openagents-cli/src/cli.ts -
modified
packages/openagents-cli/src/coder-ollama.ts -
added
packages/openagents-cli/src/coder-shell.ts -
modified
packages/openagents-cli/src/coder-tools.ts -
modified
packages/openagents-cli/test/coder-ollama.test.ts -
added
packages/openagents-cli/test/coder-shell.test.ts
Diff
8 files changed, +355 -12
docs/assure-repo/false-green-candidates.v1.json modified +1 -1
@@ -4,7 +4,7 @@
| 4 | 4 |
|
| 5 | 5 |
|
| 6 | 6 |
|
| 7 |
|
|
| 7 |
|
|
| 8 | 8 |
|
| 9 | 9 |
|
| 10 | 10 |
|
docs/assure-repo/surface-inventory.v1.json modified +2 -2
@@ -1,7 +1,7 @@
| 1 | 1 |
|
| 2 | 2 |
|
| 3 | 3 |
|
| 4 |
|
|
| 4 |
|
|
| 5 | 5 |
|
| 6 | 6 |
|
| 7 | 7 |
|
packages/openagents-cli/src/cli.ts modified +2 -1
@@ -35,7 +35,7 @@ import {
| 35 | 35 |
|
| 36 | 36 |
|
| 37 | 37 |
|
| 38 |
|
|
| 38 |
|
|
| 39 | 39 |
|
| 40 | 40 |
|
| 41 | 41 |
|
@@ -1770,6 +1770,7 @@ const coderCommand = Command.make(
| 1770 | 1770 |
|
| 1771 | 1771 |
|
| 1772 | 1772 |
|
| 1773 |
|
|
| 1773 | 1774 |
|
| 1774 | 1775 |
|
| 1775 | 1776 |
|
packages/openagents-cli/src/coder-ollama.ts modified +12 -7
@@ -113,19 +113,24 @@ const systemPrompt = (tools: ReadonlyArray<CoderTool>): string => {
| 113 | 113 |
|
| 114 | 114 |
|
| 115 | 115 |
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 | 119 |
|
| 120 | 120 |
|
| 121 | 121 |
|
| 122 | 122 |
|
| 123 | 123 |
|
| 124 | 124 |
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 129 | 134 |
|
| 130 | 135 |
|
| 131 | 136 |
|
packages/openagents-cli/src/coder-shell.ts added +154
@@ -0,0 +1,154 @@
| 1 |
|
|
| 2 |
|
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105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
|
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
|
| 136 |
|
|
| 137 |
|
|
| 138 |
|
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
|
| 152 |
|
|
| 153 |
|
|
| 154 |
|
packages/openagents-cli/src/coder-tools.ts modified +69
@@ -18,6 +18,13 @@ import { existsSync } from "node:fs";
| 18 | 18 |
|
| 19 | 19 |
|
| 20 | 20 |
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 21 | 28 |
|
| 22 | 29 |
|
| 23 | 30 |
|
@@ -385,3 +392,65 @@ export function openagentsTool(): CoderTool {
| 385 | 392 |
|
| 386 | 393 |
|
| 387 | 394 |
|
| 395 |
|
|
| 396 |
|
|
| 397 |
|
|
| 398 |
|
|
| 399 |
|
|
| 400 |
|
|
| 401 |
|
|
| 402 |
|
|
| 403 |
|
|
| 404 |
|
|
| 405 |
|
|
| 406 |
|
|
| 407 |
|
|
| 408 |
|
|
| 409 |
|
|
| 410 |
|
|
| 411 |
|
|
| 412 |
|
|
| 413 |
|
|
| 414 |
|
|
| 415 |
|
|
| 416 |
|
|
| 417 |
|
|
| 418 |
|
|
| 419 |
|
|
| 420 |
|
|
| 421 |
|
|
| 422 |
|
|
| 423 |
|
|
| 424 |
|
|
| 425 |
|
|
| 426 |
|
|
| 427 |
|
|
| 428 |
|
|
| 429 |
|
|
| 430 |
|
|
| 431 |
|
|
| 432 |
|
|
| 433 |
|
|
| 434 |
|
|
| 435 |
|
|
| 436 |
|
|
| 437 |
|
|
| 438 |
|
|
| 439 |
|
|
| 440 |
|
|
| 441 |
|
|
| 442 |
|
|
| 443 |
|
|
| 444 |
|
|
| 445 |
|
|
| 446 |
|
|
| 447 |
|
|
| 448 |
|
|
| 449 |
|
|
| 450 |
|
|
| 451 |
|
|
| 452 |
|
|
| 453 |
|
|
| 454 |
|
|
| 455 |
|
|
| 456 |
|
packages/openagents-cli/test/coder-ollama.test.ts modified +4 -1
@@ -233,7 +233,10 @@ describe("what a local session tells the model about itself", () => {
| 233 | 233 |
|
| 234 | 234 |
|
| 235 | 235 |
|
| 236 |
|
|
| 236 |
|
|
| 237 |
|
|
| 238 |
|
|
| 239 |
|
|
| 237 | 240 |
|
| 238 | 241 |
|
| 239 | 242 |
|
packages/openagents-cli/test/coder-shell.test.ts added +111
@@ -0,0 +1,111 @@
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
|
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
|
| 110 |
|
|
| 111 |
|