castle-web-cli 0.4.179 → 0.4.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.js +14 -6
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -432,9 +432,13 @@ function handleModelCaps(req, res) {
|
|
|
432
432
|
}
|
|
433
433
|
// Build the headless CLI invocation for a spawning backend/role (smith never
|
|
434
434
|
// comes through here -- it has no CLI process; see runAgentSmith). Cursor's
|
|
435
|
-
// router runs in read-only ask mode; claude runs permission-mode
|
|
436
|
-
// both roles (NOT plan mode -- that makes it emit plan
|
|
437
|
-
// effort.
|
|
435
|
+
// router runs in read-only ask mode; claude runs permission-mode
|
|
436
|
+
// bypassPermissions for both roles (NOT plan mode -- that makes it emit plan
|
|
437
|
+
// tool calls) at medium effort. Not `auto`: auto mode runs a sonnet
|
|
438
|
+
// classifier call beside every turn, on Anthropic's own key, whatever --model
|
|
439
|
+
// says -- a second model's cost and a second billing line per turn. bypass
|
|
440
|
+
// asks no classifier. A cli fix is expected upstream; until then bypass is
|
|
441
|
+
// the mode. claudeModel "openrouter" keeps the SAME claude binary/flags and
|
|
438
442
|
// swaps only the model slug and env (see envForOpenrouterSpawn) -- plus one
|
|
439
443
|
// extra permission grant, see OPENROUTER_ALLOWED_TOOLS below.
|
|
440
444
|
// claude CLI 2.1.198 SILENTLY resolves `--permission-mode auto` to "default"
|
|
@@ -507,11 +511,15 @@ function claudeSettingsArg(auth) {
|
|
|
507
511
|
// new process, so that text (the kit guide: ~23k tokens on a kit deck) is sent
|
|
508
512
|
// uncached on every call of every turn. The router already carries the deck's
|
|
509
513
|
// quick reference and file tree in its cached system part, and can read a
|
|
510
|
-
// guide on demand; tasks keep the CLI's own loading.
|
|
511
|
-
//
|
|
514
|
+
// guide on demand; tasks keep the CLI's own loading. Auto memory is off for the
|
|
515
|
+
// same reason: the first process in a deck creates the memory store, the next
|
|
516
|
+
// one's system prompt gains a memory block, and the cached prefix only matches
|
|
517
|
+
// from the third turn on. Measured on a 30k-token router prompt: a second turn
|
|
518
|
+
// goes from 50k tokens written to 6k.
|
|
512
519
|
const ROUTER_CLAUDE_ENV = {
|
|
513
520
|
CLAUDE_CODE_DISABLE_CLAUDE_MDS: '1',
|
|
514
521
|
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS: '1',
|
|
522
|
+
CLAUDE_CODE_DISABLE_AUTO_MEMORY: '1',
|
|
515
523
|
};
|
|
516
524
|
function buildAgentInvocation(backend, role, prompt, claudeModel,
|
|
517
525
|
// Already resolved for this role by the caller (router turns pass
|
|
@@ -549,7 +557,7 @@ systemPrompt) {
|
|
|
549
557
|
'stream-json',
|
|
550
558
|
'--include-partial-messages',
|
|
551
559
|
'--permission-mode',
|
|
552
|
-
'
|
|
560
|
+
'bypassPermissions',
|
|
553
561
|
...(viaOpenrouter ? [openrouterAllowedToolsArg(role)] : []),
|
|
554
562
|
'--model',
|
|
555
563
|
viaOpenrouter ? openrouterModel : claudeModel,
|