@caupulican/pi-adaptative 0.81.26 → 0.81.29
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/CHANGELOG.md +45 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +3 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +4 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +19 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +30 -12
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +128 -36
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +6 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +35 -0
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
- package/dist/core/autonomy/bounded-completion.js +59 -19
- package/dist/core/autonomy/bounded-completion.js.map +1 -1
- package/dist/core/autonomy/contracts.d.ts +2 -0
- package/dist/core/autonomy/contracts.d.ts.map +1 -1
- package/dist/core/autonomy/contracts.js.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.d.ts +31 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -0
- package/dist/core/autonomy/lane-tool-surface.js +96 -0
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -0
- package/dist/core/autonomy/lane-tracker.d.ts +5 -0
- package/dist/core/autonomy/lane-tracker.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tracker.js +14 -3
- package/dist/core/autonomy/lane-tracker.js.map +1 -1
- package/dist/core/background-lane-controller.d.ts +28 -4
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +237 -28
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/billing-failover-controller.d.ts.map +1 -1
- package/dist/core/billing-failover-controller.js +1 -1
- package/dist/core/billing-failover-controller.js.map +1 -1
- package/dist/core/context/current-work-memory.d.ts +9 -0
- package/dist/core/context/current-work-memory.d.ts.map +1 -0
- package/dist/core/context/current-work-memory.js +61 -0
- package/dist/core/context/current-work-memory.js.map +1 -0
- package/dist/core/context/file-store-memory-provider.d.ts +9 -0
- package/dist/core/context/file-store-memory-provider.d.ts.map +1 -0
- package/dist/core/context/file-store-memory-provider.js +106 -0
- package/dist/core/context/file-store-memory-provider.js.map +1 -0
- package/dist/core/context/long-term-memory-trigger.d.ts +15 -0
- package/dist/core/context/long-term-memory-trigger.d.ts.map +1 -0
- package/dist/core/context/long-term-memory-trigger.js +39 -0
- package/dist/core/context/long-term-memory-trigger.js.map +1 -0
- package/dist/core/context/memory-prompt-block.d.ts +3 -1
- package/dist/core/context/memory-prompt-block.d.ts.map +1 -1
- package/dist/core/context/memory-prompt-block.js +20 -3
- package/dist/core/context/memory-prompt-block.js.map +1 -1
- package/dist/core/context/memory-prompt-budget.d.ts +17 -0
- package/dist/core/context/memory-prompt-budget.d.ts.map +1 -0
- package/dist/core/context/memory-prompt-budget.js +64 -0
- package/dist/core/context/memory-prompt-budget.js.map +1 -0
- package/dist/core/context/memory-provider-contract.d.ts.map +1 -1
- package/dist/core/context/memory-provider-contract.js +2 -5
- package/dist/core/context/memory-provider-contract.js.map +1 -1
- package/dist/core/context/memory-tier-composer.d.ts +27 -0
- package/dist/core/context/memory-tier-composer.d.ts.map +1 -0
- package/dist/core/context/memory-tier-composer.js +79 -0
- package/dist/core/context/memory-tier-composer.js.map +1 -0
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +2 -0
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/context-pipeline.d.ts +5 -3
- package/dist/core/context-pipeline.d.ts.map +1 -1
- package/dist/core/context-pipeline.js +15 -5
- package/dist/core/context-pipeline.js.map +1 -1
- package/dist/core/cost/cost-summary.d.ts +3 -1
- package/dist/core/cost/cost-summary.d.ts.map +1 -1
- package/dist/core/cost/cost-summary.js +3 -3
- package/dist/core/cost/cost-summary.js.map +1 -1
- package/dist/core/cost-guard.d.ts +17 -7
- package/dist/core/cost-guard.d.ts.map +1 -1
- package/dist/core/cost-guard.js +33 -10
- package/dist/core/cost-guard.js.map +1 -1
- package/dist/core/default-tool-surface.d.ts +9 -0
- package/dist/core/default-tool-surface.d.ts.map +1 -0
- package/dist/core/default-tool-surface.js +18 -0
- package/dist/core/default-tool-surface.js.map +1 -0
- package/dist/core/delegation/worker-result.d.ts.map +1 -1
- package/dist/core/delegation/worker-result.js +3 -0
- package/dist/core/delegation/worker-result.js.map +1 -1
- package/dist/core/delegation/worker-runner.d.ts +11 -5
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +77 -16
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +15 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +2 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +9 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/failure-corpus.d.ts.map +1 -1
- package/dist/core/failure-corpus.js +2 -4
- package/dist/core/failure-corpus.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +9 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.js +4 -3
- package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +12 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +42 -4
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/local-runtime-controller.d.ts +16 -0
- package/dist/core/local-runtime-controller.d.ts.map +1 -1
- package/dist/core/local-runtime-controller.js +107 -28
- package/dist/core/local-runtime-controller.js.map +1 -1
- package/dist/core/memory/memory-manager.d.ts +8 -3
- package/dist/core/memory/memory-manager.d.ts.map +1 -1
- package/dist/core/memory/memory-manager.js +27 -11
- package/dist/core/memory/memory-manager.js.map +1 -1
- package/dist/core/memory/memory-provider.d.ts +5 -1
- package/dist/core/memory/memory-provider.d.ts.map +1 -1
- package/dist/core/memory/memory-provider.js.map +1 -1
- package/dist/core/memory/providers/file-store.d.ts +3 -1
- package/dist/core/memory/providers/file-store.d.ts.map +1 -1
- package/dist/core/memory/providers/file-store.js +7 -2
- package/dist/core/memory/providers/file-store.js.map +1 -1
- package/dist/core/memory/providers/transcript-recall.d.ts +1 -0
- package/dist/core/memory/providers/transcript-recall.d.ts.map +1 -1
- package/dist/core/memory/providers/transcript-recall.js +4 -7
- package/dist/core/memory/providers/transcript-recall.js.map +1 -1
- package/dist/core/memory-controller.d.ts +36 -10
- package/dist/core/memory-controller.d.ts.map +1 -1
- package/dist/core/memory-controller.js +137 -21
- package/dist/core/memory-controller.js.map +1 -1
- package/dist/core/model-registry.d.ts +25 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +91 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +30 -11
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +33 -29
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/model-selection-controller.d.ts +3 -0
- package/dist/core/model-selection-controller.d.ts.map +1 -1
- package/dist/core/model-selection-controller.js +8 -1
- package/dist/core/model-selection-controller.js.map +1 -1
- package/dist/core/models/local-runtime.d.ts +2 -0
- package/dist/core/models/local-runtime.d.ts.map +1 -1
- package/dist/core/models/local-runtime.js +10 -4
- package/dist/core/models/local-runtime.js.map +1 -1
- package/dist/core/models/perf-profile.d.ts.map +1 -1
- package/dist/core/models/perf-profile.js +95 -33
- package/dist/core/models/perf-profile.js.map +1 -1
- package/dist/core/models/runtime-arbiter.d.ts +11 -0
- package/dist/core/models/runtime-arbiter.d.ts.map +1 -1
- package/dist/core/models/runtime-arbiter.js +35 -13
- package/dist/core/models/runtime-arbiter.js.map +1 -1
- package/dist/core/profile-filter-controller.d.ts +11 -0
- package/dist/core/profile-filter-controller.d.ts.map +1 -1
- package/dist/core/profile-filter-controller.js +56 -11
- package/dist/core/profile-filter-controller.js.map +1 -1
- package/dist/core/profile-registry.d.ts +2 -2
- package/dist/core/profile-registry.d.ts.map +1 -1
- package/dist/core/profile-registry.js +58 -7
- package/dist/core/profile-registry.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +9 -7
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +81 -12
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/research/research-runner.d.ts +2 -2
- package/dist/core/research/research-runner.d.ts.map +1 -1
- package/dist/core/research/research-runner.js +8 -6
- package/dist/core/research/research-runner.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -2
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +11 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-builder.d.ts +30 -3
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +140 -40
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/sdk.d.ts +8 -7
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +38 -5
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/security/secret-text.d.ts +3 -0
- package/dist/core/security/secret-text.d.ts.map +1 -0
- package/dist/core/security/secret-text.js +26 -0
- package/dist/core/security/secret-text.js.map +1 -0
- package/dist/core/settings-manager.d.ts +59 -17
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +300 -51
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +7 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +23 -1
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/tool-gate-controller.d.ts +3 -0
- package/dist/core/tool-gate-controller.d.ts.map +1 -1
- package/dist/core/tool-gate-controller.js +20 -15
- package/dist/core/tool-gate-controller.js.map +1 -1
- package/dist/core/tool-selection/expected-utility.d.ts +51 -0
- package/dist/core/tool-selection/expected-utility.d.ts.map +1 -0
- package/dist/core/tool-selection/expected-utility.js +85 -0
- package/dist/core/tool-selection/expected-utility.js.map +1 -0
- package/dist/core/tool-selection/tool-performance-store.d.ts +82 -0
- package/dist/core/tool-selection/tool-performance-store.d.ts.map +1 -0
- package/dist/core/tool-selection/tool-performance-store.js +249 -0
- package/dist/core/tool-selection/tool-performance-store.js.map +1 -0
- package/dist/core/tool-selection/tool-selection-controller.d.ts +41 -0
- package/dist/core/tool-selection/tool-selection-controller.d.ts.map +1 -0
- package/dist/core/tool-selection/tool-selection-controller.js +199 -0
- package/dist/core/tool-selection/tool-selection-controller.js.map +1 -0
- package/dist/core/tools/delegate-status.d.ts +9 -0
- package/dist/core/tools/delegate-status.d.ts.map +1 -0
- package/dist/core/tools/delegate-status.js +52 -0
- package/dist/core/tools/delegate-status.js.map +1 -0
- package/dist/core/tools/delegate.d.ts +10 -0
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +36 -13
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/run-toolkit-script.d.ts +3 -0
- package/dist/core/tools/run-toolkit-script.d.ts.map +1 -1
- package/dist/core/tools/run-toolkit-script.js +17 -7
- package/dist/core/tools/run-toolkit-script.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +69 -29
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/config-backup.d.ts +7 -1
- package/dist/modes/interactive/config-backup.d.ts.map +1 -1
- package/dist/modes/interactive/config-backup.js +196 -32
- package/dist/modes/interactive/config-backup.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +22 -28
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/local-model-commands.d.ts.map +1 -1
- package/dist/modes/interactive/local-model-commands.js +2 -0
- package/dist/modes/interactive/local-model-commands.js.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.d.ts +6 -4
- package/dist/modes/interactive/profile-menu-controller.d.ts.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.js +248 -65
- package/dist/modes/interactive/profile-menu-controller.js.map +1 -1
- package/dist/modes/interactive/report-commands.d.ts.map +1 -1
- package/dist/modes/interactive/report-commands.js +8 -2
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.d.ts.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.js +8 -0
- package/dist/modes/interactive/settings-selector-flow.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +3 -1
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/docs/extensions.md +32 -0
- package/docs/integration-sweep-builder-blueprint-2026-07-09.md +365 -0
- package/docs/integration-sweep-resume-2026-07-09.md +407 -0
- package/docs/resources.md +15 -7
- package/docs/settings.md +56 -5
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/preset.ts +2 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +44 -35
- package/package.json +4 -4
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# Integration Sweep Resume Note — 2026-07-09
|
|
2
|
+
|
|
3
|
+
Status: paused by user after a second work slice; implementation is intentionally uncommitted and
|
|
4
|
+
ready to resume. The latest slice has not yet been re-tested.
|
|
5
|
+
|
|
6
|
+
## Scope
|
|
7
|
+
|
|
8
|
+
Synchronize and simplify these host subsystems while prioritizing foreground performance and
|
|
9
|
+
accuracy:
|
|
10
|
+
|
|
11
|
+
- toolkit store and deterministic toolkit routing;
|
|
12
|
+
- shared tool repair and isolated child loops;
|
|
13
|
+
- local-model lifecycle, routing, residency, and background lanes;
|
|
14
|
+
- memory and file-backed tool-output artifacts;
|
|
15
|
+
- worker/subagent contracts and accounting;
|
|
16
|
+
- generic external memory-provider compatibility.
|
|
17
|
+
|
|
18
|
+
Do not modify Pi extensions. In particular, no files under
|
|
19
|
+
`/home/caudev/__pi/agent/extensions` were changed. Graphify was inspected only as an external
|
|
20
|
+
consumer of the host's generic tool and context-memory-provider contracts.
|
|
21
|
+
|
|
22
|
+
## Design decisions
|
|
23
|
+
|
|
24
|
+
1. Foreground first: optional local curation/background work must not compete with a local user
|
|
25
|
+
turn.
|
|
26
|
+
2. One model-call gateway: foreground, routed, and isolated calls must share managed-local
|
|
27
|
+
readiness, repair telemetry, timeout behavior, and accounting.
|
|
28
|
+
3. Reuse a configured healthy Ollama server when it exposes the requested model. Server/store
|
|
29
|
+
ownership is not a capability boundary.
|
|
30
|
+
4. Residency admission must not synchronously cold-load Ollama with an empty generation. The real
|
|
31
|
+
adaptive stream owns cold load and prefill timing.
|
|
32
|
+
5. Preserve exact oversized tool output in retrievable artifacts; send bounded previews to models.
|
|
33
|
+
6. Use compact structured model-to-model contracts. Do not use Unicode/Braille as compression;
|
|
34
|
+
measure tokenizer cost instead.
|
|
35
|
+
7. Future automatic tool selection should use constrained expected utility, not another free-form
|
|
36
|
+
judge:
|
|
37
|
+
|
|
38
|
+
`utility = success_probability * value - latency_cost - token_cost - risk_cost - context_cost`
|
|
39
|
+
|
|
40
|
+
Hard capability/path/profile gates run first; ambiguous rankings return a shortlist or defer to
|
|
41
|
+
the foreground model.
|
|
42
|
+
|
|
43
|
+
## Implemented in the working tree
|
|
44
|
+
|
|
45
|
+
### Local model reliability and performance
|
|
46
|
+
|
|
47
|
+
- `ReflectionController.runIsolatedCompletion` now calls a shared managed-local readiness gate, so
|
|
48
|
+
research, workers, route judges, curation, reflex interpretation, fitness probes, and other
|
|
49
|
+
isolated calls no longer bypass local runtime startup.
|
|
50
|
+
- Manual/default local foreground models now receive readiness handling even when the model router
|
|
51
|
+
is disabled.
|
|
52
|
+
- A healthy configured Ollama server is reused when `/api/tags` contains the requested model,
|
|
53
|
+
regardless of whether its store is Pi-owned, user-owned, or externally managed.
|
|
54
|
+
- Ollama detection now carries the live server's model list in `LocalRuntimeStatus`, so the initial
|
|
55
|
+
readiness pass uses one `/api/tags` request instead of detecting and listing separately.
|
|
56
|
+
- A running server missing the requested model fails visibly instead of being used incorrectly.
|
|
57
|
+
- Runtime residency adapters are collected into one session-wide view instead of constructing an
|
|
58
|
+
arbiter that sees only the current runtime.
|
|
59
|
+
- Residency supports admission/eviction without loading the model. The local controller uses this
|
|
60
|
+
mode to avoid a blocking empty `/api/generate` with a 60-second timeout before the real request.
|
|
61
|
+
- Already-resident models no longer receive redundant activation calls from the arbiter.
|
|
62
|
+
- Local curator draining is deferred while both the foreground and curator models are managed-local,
|
|
63
|
+
preventing a fire-and-forget curator from taking a single-parallel Ollama slot before the user
|
|
64
|
+
request.
|
|
65
|
+
- A focused local-priority regression test was added but has not yet been run.
|
|
66
|
+
|
|
67
|
+
### Tool repair
|
|
68
|
+
|
|
69
|
+
- Isolated child tool loops now forward `onToolArgumentValidation` and
|
|
70
|
+
`onToolValidationEscalation`, so their deterministic repairs and repeated validation failures use
|
|
71
|
+
the same telemetry/adaptation path as foreground calls.
|
|
72
|
+
|
|
73
|
+
### Toolkit output artifacts
|
|
74
|
+
|
|
75
|
+
- `run_toolkit_script` now stores exact oversized stdout/stderr in the session artifact store and
|
|
76
|
+
returns an 8 KiB/400-line bounded preview plus an `artifact_retrieve` handle.
|
|
77
|
+
- Exit status and failure text remain in the preview; toolkit output is marked non-reproducible.
|
|
78
|
+
|
|
79
|
+
## Live diagnosis captured
|
|
80
|
+
|
|
81
|
+
- The active Pi config is under `~/.pi/agent`.
|
|
82
|
+
- Its Ollama provider targets `http://localhost:11434/v1` and registers local qwen/MiniCPM models.
|
|
83
|
+
- The model router was disabled at inspection time, but local cheap/executor models remained
|
|
84
|
+
configured.
|
|
85
|
+
- No Ollama server was running during inspection and no Linux Ollama binary was found in PATH or the
|
|
86
|
+
Pi runtime directory.
|
|
87
|
+
- Another local configuration under `~/__pi/agent` targets a manually served Windows/WSL endpoint.
|
|
88
|
+
- The prior host policy rejected non-Pi-owned running stores and synchronously preloaded models;
|
|
89
|
+
these were concrete causes of manual-server performance being better and local use failing.
|
|
90
|
+
|
|
91
|
+
## Focused validation completed
|
|
92
|
+
|
|
93
|
+
From `packages/coding-agent`:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
node ../../node_modules/vitest/dist/cli.js --run \
|
|
97
|
+
test/run-toolkit-script.test.ts \
|
|
98
|
+
test/isolated-child-loop.test.ts \
|
|
99
|
+
test/agent-session-local-runtime.test.ts \
|
|
100
|
+
test/runtime-arbiter.test.ts \
|
|
101
|
+
test/brain-curator.test.ts \
|
|
102
|
+
test/context-pipeline-token-budget.test.ts
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Result: 6 files passed, 65 tests passed.
|
|
106
|
+
|
|
107
|
+
Earlier focused run also passed the existing local runtime and isolated child tests after the
|
|
108
|
+
readiness changes.
|
|
109
|
+
|
|
110
|
+
`npm run check` has not been run yet because the user paused the sweep before final validation.
|
|
111
|
+
|
|
112
|
+
Important: after that 65-test green run, the second slice changed `LocalRuntimeStatus` to include
|
|
113
|
+
`serverModels` and added `context-pipeline-local-priority.test.ts`. Those latest changes have not yet
|
|
114
|
+
been compiled or tested.
|
|
115
|
+
|
|
116
|
+
## Files changed by this sweep
|
|
117
|
+
|
|
118
|
+
- `packages/coding-agent/src/core/agent-session.ts`
|
|
119
|
+
- `packages/coding-agent/src/core/context-pipeline.ts`
|
|
120
|
+
- `packages/coding-agent/src/core/local-runtime-controller.ts`
|
|
121
|
+
- `packages/coding-agent/src/core/models/runtime-arbiter.ts`
|
|
122
|
+
- `packages/coding-agent/src/core/reflection-controller.ts`
|
|
123
|
+
- `packages/coding-agent/src/core/runtime-builder.ts`
|
|
124
|
+
- `packages/coding-agent/src/core/tools/run-toolkit-script.ts`
|
|
125
|
+
- `packages/coding-agent/test/agent-session-local-runtime.test.ts`
|
|
126
|
+
- `packages/coding-agent/test/context-pipeline-token-budget.test.ts`
|
|
127
|
+
- `packages/coding-agent/test/context-pipeline-local-priority.test.ts`
|
|
128
|
+
- `packages/coding-agent/test/isolated-child-loop.test.ts`
|
|
129
|
+
- `packages/coding-agent/test/run-toolkit-script.test.ts`
|
|
130
|
+
- `packages/coding-agent/test/runtime-arbiter.test.ts`
|
|
131
|
+
- this resume note.
|
|
132
|
+
|
|
133
|
+
`packages/coding-agent/docs/bug-ledger.md` was already modified before this sweep and was not edited
|
|
134
|
+
as part of this work.
|
|
135
|
+
|
|
136
|
+
## Remaining work: exact execution plan
|
|
137
|
+
|
|
138
|
+
### 1. Stabilize the latest local-runtime changes
|
|
139
|
+
|
|
140
|
+
Files:
|
|
141
|
+
|
|
142
|
+
- `src/core/models/local-runtime.ts`
|
|
143
|
+
- `src/core/local-runtime-controller.ts`
|
|
144
|
+
- `src/core/models/runtime-arbiter.ts`
|
|
145
|
+
- `test/agent-session-local-runtime.test.ts`
|
|
146
|
+
- `test/runtime-arbiter.test.ts`
|
|
147
|
+
|
|
148
|
+
How:
|
|
149
|
+
|
|
150
|
+
1. Compile/run the focused tests first. `LocalRuntimeStatus.serverModels` is newly required, so faux
|
|
151
|
+
status literals in other tests may need `serverModels: []`.
|
|
152
|
+
2. Check that one cold readiness pass performs:
|
|
153
|
+
- one `/api/tags` request for reachability plus requested-model presence;
|
|
154
|
+
- one `/api/ps` request for residency accounting;
|
|
155
|
+
- no empty `/api/generate` preload;
|
|
156
|
+
- then the real OpenAI-compatible stream, whose adaptive local connect bound owns cold load and
|
|
157
|
+
prefill.
|
|
158
|
+
3. Keep `_confirmedUp` as the steady-state fast path: subsequent successful turns should perform no
|
|
159
|
+
readiness HTTP requests until a matching local assistant error invalidates the key.
|
|
160
|
+
4. Verify a manually managed server is accepted only when it exposes the exact requested model or
|
|
161
|
+
the bare/`:latest` equivalent. A reachable server without the model must return
|
|
162
|
+
`model_missing_on_server`, not proceed and fail later.
|
|
163
|
+
5. Review session-wide residency adapter identities for multiple Ollama URLs and Transformers
|
|
164
|
+
models. They must not collide.
|
|
165
|
+
|
|
166
|
+
Expected:
|
|
167
|
+
|
|
168
|
+
- Manually started Ollama keeps its own binary, GPU/backend configuration, model store, and warm
|
|
169
|
+
cache.
|
|
170
|
+
- Pi starts its managed server only when the configured endpoint is down and a usable binary exists.
|
|
171
|
+
- No duplicate server is started against an already reachable configured endpoint.
|
|
172
|
+
- Local route, manual model, judge, research, worker, curation, reflex, and fitness calls all pass
|
|
173
|
+
through readiness.
|
|
174
|
+
- Foreground failure remains visible and router fallback remains bounded/explicit.
|
|
175
|
+
|
|
176
|
+
Acceptance tests:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
cd packages/coding-agent
|
|
180
|
+
node ../../node_modules/vitest/dist/cli.js --run \
|
|
181
|
+
test/agent-session-local-runtime.test.ts \
|
|
182
|
+
test/runtime-arbiter.test.ts \
|
|
183
|
+
test/model-perf-profile.test.ts \
|
|
184
|
+
test/isolated-child-loop.test.ts
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 2. Finish foreground-priority behavior
|
|
188
|
+
|
|
189
|
+
Files:
|
|
190
|
+
|
|
191
|
+
- `src/core/context-pipeline.ts`
|
|
192
|
+
- `test/context-pipeline-local-priority.test.ts`
|
|
193
|
+
- optionally `test/brain-curator.test.ts` if a session-level regression is clearer.
|
|
194
|
+
|
|
195
|
+
How:
|
|
196
|
+
|
|
197
|
+
1. Run the newly added local-priority test and correct type/faux-dependency issues.
|
|
198
|
+
2. Keep queued curator work intact when both foreground and curator are managed-local.
|
|
199
|
+
3. Add a second assertion or test proving the same queued job can drain later when the foreground is
|
|
200
|
+
a cloud model or no local foreground is active. Do not drop or mark the job completed on defer.
|
|
201
|
+
4. Keep the visible reason code `curation_deferred_for_local_foreground` in diagnostics.
|
|
202
|
+
|
|
203
|
+
Expected:
|
|
204
|
+
|
|
205
|
+
- Optional curation never takes a single-parallel local server slot before a user request.
|
|
206
|
+
- Deferral loses no work; curation can run on a later non-competing turn.
|
|
207
|
+
- Cloud foreground plus local curator remains allowed unless profiling later shows host CPU pressure.
|
|
208
|
+
|
|
209
|
+
### 3. Complete toolkit/artifact integration
|
|
210
|
+
|
|
211
|
+
Files:
|
|
212
|
+
|
|
213
|
+
- `src/core/tools/run-toolkit-script.ts`
|
|
214
|
+
- `src/core/runtime-builder.ts`
|
|
215
|
+
- `test/run-toolkit-script.test.ts`
|
|
216
|
+
|
|
217
|
+
How:
|
|
218
|
+
|
|
219
|
+
1. Re-run the artifact regression.
|
|
220
|
+
2. Confirm the active-tool companion rule always activates `artifact_retrieve` when
|
|
221
|
+
`run_toolkit_script` can emit an artifact. The current runtime only auto-adds the companion for
|
|
222
|
+
`grep`/`find`; either extend that condition to toolkit or suppress the artifact store when the
|
|
223
|
+
retrieval tool is not active. Never emit an unresolvable handle.
|
|
224
|
+
3. Keep the preview bounded at 8 KiB/400 lines unless measurement supports a smaller cap.
|
|
225
|
+
4. Preserve exit code, timeout state, first failure text, stdout/stderr labels, and exact full output
|
|
226
|
+
in the artifact.
|
|
227
|
+
5. Verify context-GC reference release recognizes toolkit `details.artifactId` exactly as it does for
|
|
228
|
+
grep/find.
|
|
229
|
+
|
|
230
|
+
Expected:
|
|
231
|
+
|
|
232
|
+
- Small script output stays directly readable.
|
|
233
|
+
- Large output never bloats prompt context and is never lost.
|
|
234
|
+
- Every emitted artifact handle is resolvable in the same active tool surface.
|
|
235
|
+
- Failed scripts remain unmistakably failed even when output is packed.
|
|
236
|
+
|
|
237
|
+
### 4. Tool-selection policy: observe first
|
|
238
|
+
|
|
239
|
+
Do not add an orphan policy module. Integrate only when its inputs and output have live owners.
|
|
240
|
+
|
|
241
|
+
Suggested files:
|
|
242
|
+
|
|
243
|
+
- new `src/core/tool-selection/expected-utility.ts` for pure math;
|
|
244
|
+
- new `src/core/tool-selection/tool-performance-store.ts` for bounded host/model/tool statistics;
|
|
245
|
+
- `src/core/tool-gate-controller.ts` for execution outcomes/timing;
|
|
246
|
+
- `src/core/system-prompt-builder.ts` or a dedicated pre-turn controller for a compact recommendation;
|
|
247
|
+
- focused tests under `test/tool-selection-*.test.ts`.
|
|
248
|
+
|
|
249
|
+
How:
|
|
250
|
+
|
|
251
|
+
1. Candidate generation uses only active, profile-allowed, capability-compatible tools.
|
|
252
|
+
2. Hard gates run before scoring: denied tool/path/capability never becomes a candidate.
|
|
253
|
+
3. Maintain per `(host, model ref, intent class, tool)` bounded statistics:
|
|
254
|
+
- Beta posterior `alpha/beta` for success probability;
|
|
255
|
+
- latency EWMA and bounded deviation;
|
|
256
|
+
- prompt/output-token EWMA where observable;
|
|
257
|
+
- repair/bounce/failure counts;
|
|
258
|
+
- last-used timestamp and sample count.
|
|
259
|
+
4. Score candidates with normalized units:
|
|
260
|
+
|
|
261
|
+
`U(t) = Psuccess(t) * value(t) - λL*latency(t) - λT*tokens(t) - λR*risk(t) - λC*context(t)`
|
|
262
|
+
|
|
263
|
+
5. Include `no_tool` as a real candidate with zero cost and an intent-dependent value.
|
|
264
|
+
6. Recommend a tool only when:
|
|
265
|
+
- best utility is positive;
|
|
266
|
+
- best-minus-runner-up exceeds a configured margin;
|
|
267
|
+
- minimum evidence exists, or the match is deterministic name/alias/schema intent.
|
|
268
|
+
7. Compute normalized entropy over candidate probabilities. High entropy produces a shortlist; it
|
|
269
|
+
never executes automatically.
|
|
270
|
+
8. First production slice is observe-only: persist/redact rankings and compare recommendation to the
|
|
271
|
+
model's actual choice. Do not hide tools or execute on the model's behalf.
|
|
272
|
+
9. Promote to a concise prompt hint only after offline replay shows higher first-tool success and no
|
|
273
|
+
increase in unsafe/wrong-tool calls.
|
|
274
|
+
|
|
275
|
+
Expected:
|
|
276
|
+
|
|
277
|
+
- Exact toolkit/name hits remain deterministic and model-call-free.
|
|
278
|
+
- Repeated host/model workflows improve from observed outcomes.
|
|
279
|
+
- Ambiguity remains conservative.
|
|
280
|
+
- The selector reduces wrong first tools, retries, latency, and context cost without becoming another
|
|
281
|
+
prompt-heavy router.
|
|
282
|
+
|
|
283
|
+
Acceptance metrics:
|
|
284
|
+
|
|
285
|
+
- first-tool success rate;
|
|
286
|
+
- wrong-tool/refusal rate;
|
|
287
|
+
- p50/p95 time to first useful tool result;
|
|
288
|
+
- tool-related input/output tokens;
|
|
289
|
+
- repair and validation-bounce rate;
|
|
290
|
+
- shortlist/abstention calibration;
|
|
291
|
+
- no regression in capability/path gate enforcement.
|
|
292
|
+
|
|
293
|
+
### 5. Worker semantics
|
|
294
|
+
|
|
295
|
+
Files:
|
|
296
|
+
|
|
297
|
+
- `src/core/delegation/worker-runner.ts`
|
|
298
|
+
- `src/core/background-lane-controller.ts`
|
|
299
|
+
- `src/core/delegation/worker-result.ts`
|
|
300
|
+
- worker delegation tests.
|
|
301
|
+
|
|
302
|
+
Current fact: direct write/edit tools and structured actions may mutate inside the capability
|
|
303
|
+
envelope before `validateWorkerResult` returns `parent_review_required`.
|
|
304
|
+
|
|
305
|
+
How:
|
|
306
|
+
|
|
307
|
+
1. Do not silently remove the intentional write lane.
|
|
308
|
+
2. Choose and document one explicit contract:
|
|
309
|
+
- review-after-apply: envelope authorization permits mutation; parent reviews/validates afterward;
|
|
310
|
+
- staged apply: worker returns structured actions/patches, parent gate accepts, then runner applies.
|
|
311
|
+
3. If staged apply is selected, direct write/edit tools must also target a staging layer; otherwise
|
|
312
|
+
only structured actions are truly staged.
|
|
313
|
+
4. Preserve symlink-aware path enforcement, changed-file accounting on partial failure, blockers, and
|
|
314
|
+
spawned usage under either contract.
|
|
315
|
+
|
|
316
|
+
Expected:
|
|
317
|
+
|
|
318
|
+
- User and parent can tell whether review is pre- or post-mutation.
|
|
319
|
+
- A blocked/out-of-scope action never mutates.
|
|
320
|
+
- Partial mutations never look like clean success.
|
|
321
|
+
|
|
322
|
+
### 6. External memory and Graphify compatibility
|
|
323
|
+
|
|
324
|
+
Host files only. Do not modify Pi extensions.
|
|
325
|
+
|
|
326
|
+
How:
|
|
327
|
+
|
|
328
|
+
1. Verify extension registration/reload keeps both `registerMemoryProvider` and
|
|
329
|
+
`registerContextMemoryProvider` contributions across atomic reloads.
|
|
330
|
+
2. Add/retain host tests using faux graph-capable context providers (`graph: true`) rather than
|
|
331
|
+
importing private Graphify code.
|
|
332
|
+
3. Confirm generic graph results are budgeted, source-labeled, wrapped as untrusted evidence, and
|
|
333
|
+
included only when the long-term-memory demand gate opens.
|
|
334
|
+
4. Confirm dynamic provider GC markers join context-GC markers without brand-specific host logic.
|
|
335
|
+
|
|
336
|
+
Expected:
|
|
337
|
+
|
|
338
|
+
- The host is fully ready for Graphify or any graph provider through public contracts.
|
|
339
|
+
- Private providers remain optional and can disappear/reload without breaking the session.
|
|
340
|
+
- No private brand or path becomes a package dependency.
|
|
341
|
+
|
|
342
|
+
### 7. Documentation and final validation
|
|
343
|
+
|
|
344
|
+
Update these stale planning snapshots after behavior is final:
|
|
345
|
+
|
|
346
|
+
- `docs/model-router-rework.md`
|
|
347
|
+
- `docs/model-router-rework/current-state.md`
|
|
348
|
+
- `docs/model-router-rework/local-model-lifecycle-design.md`
|
|
349
|
+
- `docs/context-management-rework/tool-output-artifacts.md`
|
|
350
|
+
- this note: change status to completed and record final test/check results.
|
|
351
|
+
|
|
352
|
+
Document:
|
|
353
|
+
|
|
354
|
+
- three-tier router and judge are implemented;
|
|
355
|
+
- autonomy/delegation/research directories exist;
|
|
356
|
+
- managed-local readiness covers every call path;
|
|
357
|
+
- configured manual Ollama servers are preferred when valid;
|
|
358
|
+
- residency admission is non-blocking;
|
|
359
|
+
- local foreground has priority over optional local sidecars;
|
|
360
|
+
- artifact coverage is grep/find/toolkit, plus any additional tools actually completed;
|
|
361
|
+
- worker mutation semantics exactly as implemented.
|
|
362
|
+
|
|
363
|
+
Final commands:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
cd /home/caudev/GitHub/mine/pi-adaptative
|
|
367
|
+
git status --short
|
|
368
|
+
|
|
369
|
+
cd packages/coding-agent
|
|
370
|
+
node ../../node_modules/vitest/dist/cli.js --run \
|
|
371
|
+
test/agent-session-local-runtime.test.ts \
|
|
372
|
+
test/runtime-arbiter.test.ts \
|
|
373
|
+
test/model-perf-profile.test.ts \
|
|
374
|
+
test/isolated-child-loop.test.ts \
|
|
375
|
+
test/context-pipeline-local-priority.test.ts \
|
|
376
|
+
test/context-pipeline-token-budget.test.ts \
|
|
377
|
+
test/brain-curator.test.ts \
|
|
378
|
+
test/run-toolkit-script.test.ts
|
|
379
|
+
|
|
380
|
+
cd /home/caudev/GitHub/mine/pi-adaptative
|
|
381
|
+
npm run check
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Fix every error, warning, and info from `npm run check`. Do not use `tail`. Do not run `npm test` or
|
|
385
|
+
`npm run build` unless requested. Do not commit unless requested.
|
|
386
|
+
|
|
387
|
+
## Resume command
|
|
388
|
+
|
|
389
|
+
Start at the repository root and inspect only; do not discard other-session changes:
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
git status --short
|
|
393
|
+
git diff -- \
|
|
394
|
+
packages/coding-agent/src/core/agent-session.ts \
|
|
395
|
+
packages/coding-agent/src/core/context-pipeline.ts \
|
|
396
|
+
packages/coding-agent/src/core/local-runtime-controller.ts \
|
|
397
|
+
packages/coding-agent/src/core/models/runtime-arbiter.ts \
|
|
398
|
+
packages/coding-agent/src/core/reflection-controller.ts \
|
|
399
|
+
packages/coding-agent/src/core/runtime-builder.ts \
|
|
400
|
+
packages/coding-agent/src/core/tools/run-toolkit-script.ts \
|
|
401
|
+
packages/coding-agent/test/agent-session-local-runtime.test.ts \
|
|
402
|
+
packages/coding-agent/test/context-pipeline-token-budget.test.ts \
|
|
403
|
+
packages/coding-agent/test/context-pipeline-local-priority.test.ts \
|
|
404
|
+
packages/coding-agent/test/isolated-child-loop.test.ts \
|
|
405
|
+
packages/coding-agent/test/run-toolkit-script.test.ts \
|
|
406
|
+
packages/coding-agent/test/runtime-arbiter.test.ts
|
|
407
|
+
```
|
package/docs/resources.md
CHANGED
|
@@ -38,14 +38,18 @@ When no source or profile exists yet, the hub surfaces a first-run nudge — **"
|
|
|
38
38
|
|
|
39
39
|
## Resource profiles
|
|
40
40
|
|
|
41
|
-
A profile is
|
|
41
|
+
A profile is a complete allow/block contract over six kinds: `extensions`, `skills`, `prompts`, `themes`, `agents`, and `tools`. Each kind takes glob-style patterns:
|
|
42
42
|
|
|
43
43
|
- **`allow`** — when non-empty, only matching resources of that kind stay available.
|
|
44
44
|
- **`block`** — removed after `allow` is applied.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Under strict UAC, an unmentioned kind is denied. Granting every resource of a kind must be explicit with `allow: ["*"]`; `block: ["*"]` means "none." This keeps a saved situation exact when new extensions, tools, or other resources are installed later.
|
|
47
47
|
|
|
48
|
-
A profile may also bind a **model**, **thinking level**, and **modelRouter** block that apply when the profile is active. Thinking is one of `off`, `minimal`, `low`, `medium`, `high`, `xhigh`. Explicit CLI flags still win over a profile's foreground model/thinking, which in turn win over the settings default. A profile's `modelRouter` block overrides
|
|
48
|
+
A profile may also bind a **model**, **thinking level**, **soul**, and **modelRouter** block that apply when the profile is active. Thinking is one of `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`, or `ultra`. Ultra uses the model's strongest mapped reasoning level and reinforces proactive delegation when the `delegate` tool is granted; delegation itself remains available independently on capable models. Explicit CLI flags still win over a profile's foreground model/thinking, which in turn win over the settings default. A profile's `modelRouter` block overrides matching global/project router fields while that situation is active.
|
|
49
|
+
|
|
50
|
+
Pi activates the complete situation as one runtime generation: model/router, thinking, soul, extensions, skills, prompts, agents, themes, and tools are reloaded together. A failed reload restores the prior valid generation instead of persisting a partial selection.
|
|
51
|
+
|
|
52
|
+
Built-in research and worker lanes also ship a profile as one unit: its model, thinking, soul, and tool filter govern the isolated child loop. Lane tool globs expand to exact names over Pi's classified lane surface. Research can receive only `read`, `grep`, `find`, and `ls`; workers can additionally receive `write` and `edit` only with the explicit write setting and path roots. Recursive delegation, shell, memory/lifecycle tools, and extension tools without capability metadata stay fail-closed. A concrete profile grant that cannot bind to this classified surface produces a deduplicated warning instead of silently gaining authority.
|
|
49
53
|
|
|
50
54
|
Profiles are stored in settings under `resourceProfiles`, and the active one(s) in `activeResourceProfile`:
|
|
51
55
|
|
|
@@ -53,15 +57,19 @@ Profiles are stored in settings under `resourceProfiles`, and the active one(s)
|
|
|
53
57
|
{
|
|
54
58
|
"resourceProfiles": {
|
|
55
59
|
"review": {
|
|
56
|
-
"
|
|
57
|
-
"
|
|
60
|
+
"thinking": "high",
|
|
61
|
+
"soul": "Review carefully and do not edit files.",
|
|
62
|
+
"resources": {
|
|
63
|
+
"tools": { "allow": ["read", "grep", "find", "ls", "bash"] },
|
|
64
|
+
"extensions": { "block": ["*"] }
|
|
65
|
+
}
|
|
58
66
|
}
|
|
59
67
|
},
|
|
60
68
|
"activeResourceProfile": "review"
|
|
61
69
|
}
|
|
62
70
|
```
|
|
63
71
|
|
|
64
|
-
`activeResourceProfile` accepts a single name or an array; multiple active profiles are merged. Switch the active profile any time with `/profiles`.
|
|
72
|
+
`activeResourceProfile` accepts a single name or an array; multiple active profiles are merged. Legacy resource-only entries without the `resources` wrapper remain accepted. Switch the active profile any time with `/profiles`.
|
|
65
73
|
|
|
66
74
|
> The older `disabledResources` block lists still work as a simple reversible "turn these off" filter. Profiles are the richer, named, reusable form.
|
|
67
75
|
|
|
@@ -169,7 +177,7 @@ Back up your personal configuration — profile definitions and resource setting
|
|
|
169
177
|
/config-restore my.json # merges it back, after confirmation
|
|
170
178
|
```
|
|
171
179
|
|
|
172
|
-
The backup bundles
|
|
180
|
+
The backup bundles complete profile situations and resource settings (`resourceProfiles`, `activeResourceProfile`, `externalResourceRoots`, `trustedResourceRoots`). It does **not** copy the catalog itself — that is what your git repository is for.
|
|
173
181
|
|
|
174
182
|
> **Security:** restore is deliberately cautious. Restored external roots come back **untrusted**, so a new machine re-prompts before any code loads, and restore confirms before overwriting existing local config.
|
|
175
183
|
|
package/docs/settings.md
CHANGED
|
@@ -19,7 +19,7 @@ Edit directly or use `/settings` for common options.
|
|
|
19
19
|
|---------|------|---------|-------------|
|
|
20
20
|
| `defaultProvider` | string | - | Default provider (e.g., `"anthropic"`, `"openai"`) |
|
|
21
21
|
| `defaultModel` | string | - | Default model ID |
|
|
22
|
-
| `defaultThinkingLevel` | string |
|
|
22
|
+
| `defaultThinkingLevel` | string | model default | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`, or `"ultra"` |
|
|
23
23
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
24
24
|
| `thinkingBudgets` | object | - | Custom token budgets per thinking level |
|
|
25
25
|
|
|
@@ -146,6 +146,23 @@ Fitness applicability is intentionally split by autonomy level:
|
|
|
146
146
|
}
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
+
### Worker Delegation
|
|
150
|
+
|
|
151
|
+
Delegation is available by default when the active model and UAC tool surface support it. Ultra reinforces proactive use but does not own or unlock the capability. Each worker gets a fresh classified tool surface (`read`, `grep`, `find`, and `ls`); its shipped profile filters those names with the same glob semantics as foreground UAC. `delegate`, shell, memory/lifecycle tools, and opaque extension tools are never inherited into the child. Workers remain read-only unless the write toggle, a non-empty path scope, and the shipped profile all grant `write` or `edit`.
|
|
152
|
+
|
|
153
|
+
Worker writes use **review-after-apply** semantics: a gate-authorized direct `write`/`edit` call or an envelope/path-validated structured action may mutate the scoped workspace before the parent reviews the result. The parent review is therefore a post-mutation acceptance step and receives changed files, blockers, the usage report id, and `parent_review_required` for an in-scope changed result. Denied or out-of-scope actions are refused before filesystem mutation; partial application is reported as `blocked`, never clean success.
|
|
154
|
+
|
|
155
|
+
| Setting | Type | Default | Description |
|
|
156
|
+
|---------|------|---------|-------------|
|
|
157
|
+
| `workerDelegation.enabled` | boolean | `true` | Enable bounded delegation on capability-eligible models; explicit `false` is a hard off-switch |
|
|
158
|
+
| `workerDelegation.model` | string | active model | Optional worker model pattern |
|
|
159
|
+
| `workerDelegation.profile` | string | - | Complete situation profile shipped with the worker; named and workspace-relative (`./`/`../`) references are supported |
|
|
160
|
+
| `workerDelegation.maxUsd` | number | `0.5` | Maximum estimated USD per worker, clamped to 0-5 and to the parent envelope |
|
|
161
|
+
| `workerDelegation.maxWallClockMs` | number | `120000` | Per-worker wall-clock budget; `0` disables this bound |
|
|
162
|
+
| `workerDelegation.maxConcurrent` | number | `1` | Concurrent worker limit, clamped to 1-3 |
|
|
163
|
+
| `workerDelegation.writeEnabled` | boolean | `false` | Make `write`/`edit` eligible only when `writePaths` is non-empty and the lane profile grants them |
|
|
164
|
+
| `workerDelegation.writePaths` | string[] | `[]` | Relative or absolute path roots enforced for direct child tools and structured-action fallback writes |
|
|
165
|
+
|
|
149
166
|
### Tool Repair
|
|
150
167
|
|
|
151
168
|
| Setting | Type | Default | Description |
|
|
@@ -216,6 +233,7 @@ When enabled, Auto Learn keeps a small shared state file for visibility/cooldown
|
|
|
216
233
|
| `compaction.model` | string | `"auto"` | Summarizer model pattern. `auto` follows router cheap when available, but always consults exhausted-provider state and the subtractive `digest` fitness surface before falling back visibly to the session model. |
|
|
217
234
|
| `compaction.reserveTokens` | number | `16384` | Tokens reserved for LLM response |
|
|
218
235
|
| `compaction.keepRecentTokens` | number | `20000` | Recent tokens to keep (not summarized) |
|
|
236
|
+
| `compaction.triggerPercent` | number | `0.7` | Context-efficiency trigger as a fraction of the model window; separate from the USD cost guard |
|
|
219
237
|
|
|
220
238
|
```json
|
|
221
239
|
{
|
|
@@ -227,6 +245,15 @@ When enabled, Auto Learn keeps a small shared state file for visibility/cooldown
|
|
|
227
245
|
}
|
|
228
246
|
```
|
|
229
247
|
|
|
248
|
+
### Cost Guard
|
|
249
|
+
|
|
250
|
+
| Setting | Type | Default | Description |
|
|
251
|
+
|---------|------|---------|-------------|
|
|
252
|
+
| `costGuard.maxTurnUsd` | number | `2.5` | Projected per-turn USD warning ceiling; `0` disables the guard |
|
|
253
|
+
| `costGuard.action` | string | `"warn"` | `"warn"` only reports the estimate; `"downgrade"` also lowers reasoning one rung for that request without changing saved/profile state |
|
|
254
|
+
|
|
255
|
+
The projection uses the session response reserve, cached-input rates, and model-declared long-context tiers. ChatGPT subscription usage is marked `(sub)` and does not enter the USD guard.
|
|
256
|
+
|
|
230
257
|
### Context GC
|
|
231
258
|
|
|
232
259
|
Context GC only rewrites the provider-bound context view. It does not delete or mutate the canonical session log.
|
|
@@ -257,6 +284,30 @@ Semantic memory packing only targets tool results and Automata/Mind custom conte
|
|
|
257
284
|
}
|
|
258
285
|
```
|
|
259
286
|
|
|
287
|
+
### Context Memory
|
|
288
|
+
|
|
289
|
+
| Setting | Type | Default | Description |
|
|
290
|
+
|---------|------|---------|-------------|
|
|
291
|
+
| `contextPolicy.memory.enabled` | boolean | `true` | Enable local safe-auto memory retrieval |
|
|
292
|
+
| `contextPolicy.memory.includeInPrompt` | boolean | `true` | Include retrieved memory only when the active model budget permits it |
|
|
293
|
+
| `contextPolicy.memory.maxResults` | number | `5` | Maximum retrieval results before tier/budget pruning; clamped to 1-20 |
|
|
294
|
+
| `contextPolicy.memory.allowExternalEgress` | boolean | `false` | Explicitly allow eligible external memory providers to receive bounded, non-secret-like query text |
|
|
295
|
+
|
|
296
|
+
For models with `contextWindow <= 2048`, provider-visible memory is capped to 10 lines and about 200 estimated tokens total. If standing/current-work/long-term memory cannot fit that cap, Pi skips the memory block rather than overflowing context. `MEMORY.md`/`USER.md` stay in the static file-store prompt on normal windows; Pi uses the retrieval view for those files only when that static block cannot fit a compact model budget, avoiding duplicate prompt content. Custom local memory layers, such as Automata, should register a context provider with `pi.registerContextMemoryProvider`; core ships only local file-store and OKF readers. Legacy providers must declare `egress: "local"` to participate in safe-auto recall; omitted classifications fail closed as external. External memory egress requires the visible `/settings` consent or `allowExternalEgress: true`, remains bounded to 2,000 characters, and rejects labeled credentials, bearer/basic tokens, common raw provider tokens, private keys, and signed URLs. Every legacy provider recall page is centrally source-labeled and fenced as untrusted data. Live extension load/unload immediately rebuilds the memory generation, activating new providers and shutting down/removing only those owned by the unloaded extension.
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"contextPolicy": {
|
|
301
|
+
"memory": {
|
|
302
|
+
"enabled": true,
|
|
303
|
+
"includeInPrompt": true,
|
|
304
|
+
"maxResults": 5,
|
|
305
|
+
"allowExternalEgress": false
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
260
311
|
### Branch Summary
|
|
261
312
|
|
|
262
313
|
| Setting | Type | Default | Description |
|
|
@@ -301,7 +352,7 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
301
352
|
| `steeringMode` | string | `"one-at-a-time"` | How steering messages are sent: `"all"` or `"one-at-a-time"` |
|
|
302
353
|
| `followUpMode` | string | `"one-at-a-time"` | How follow-up messages are sent: `"all"` or `"one-at-a-time"` |
|
|
303
354
|
| `transport` | string | `"auto"` | Preferred transport for providers that support multiple transports: `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` |
|
|
304
|
-
| `httpIdleTimeoutMs` | number | `
|
|
355
|
+
| `httpIdleTimeoutMs` | number | `660000` | HTTP header/body idle timeout. Nonzero values constrain every phase-aware stream watchdog below the transport timeout; `0` disables only the HTTP bound. |
|
|
305
356
|
| `websocketConnectTimeoutMs` | number | `15000` | WebSocket connect/open handshake timeout in milliseconds for providers that support WebSocket transports. Set to `0` to disable. |
|
|
306
357
|
|
|
307
358
|
### Terminal & Images
|
|
@@ -374,8 +425,8 @@ Paths in `~/.pi/agent/settings.json` resolve relative to `~/.pi/agent`. Paths in
|
|
|
374
425
|
| `prompts` | string[] | `[]` | Local prompt template paths or directories |
|
|
375
426
|
| `themes` | string[] | `[]` | Local theme file paths or directories |
|
|
376
427
|
| `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands |
|
|
377
|
-
| `resourceProfiles` | object | `{}` | Named
|
|
378
|
-
| `~/.pi/agent/profiles/*.json` | files | - | Reusable named
|
|
428
|
+
| `resourceProfiles` | object | `{}` | Named complete situations or legacy allow/block filters for `extensions`, `skills`, `prompts`, `themes`, `agents`, and `tools` |
|
|
429
|
+
| `~/.pi/agent/profiles/*.json` | files | - | Reusable named situations with model, thinking, soul, router, and resource metadata |
|
|
379
430
|
| `activeResourceProfile` | string/string[] | - | Active profile name(s) |
|
|
380
431
|
| `activeResourceProfiles` | string[] | - | Active profile names; equivalent to array form of `activeResourceProfile` |
|
|
381
432
|
| `disabledResources` | object | `{}` | Legacy block filters; still supported and merged into resource profiles |
|
|
@@ -410,7 +461,7 @@ See [packages.md](packages.md) for package management details.
|
|
|
410
461
|
|
|
411
462
|
#### resourceProfiles
|
|
412
463
|
|
|
413
|
-
Resource profiles dynamically filter resources after discovery. Each resource kind supports `allow` and `block` arrays. If `allow` is non-empty, only matching resources load; `block` is applied after allow. Patterns match relative paths, absolute paths, file names, and containing directory names.
|
|
464
|
+
Resource profiles dynamically filter resources after discovery. Each resource kind supports `allow` and `block` arrays. If `allow` is non-empty, only matching resources load; `block` is applied after allow. Under strict UAC, an unmentioned kind is denied and granting an entire kind requires `allow: ["*"]`. Patterns match relative paths, absolute paths, file names, and containing directory names.
|
|
414
465
|
|
|
415
466
|
```json
|
|
416
467
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.29",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.81.
|
|
9
|
+
"version": "0.81.29",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -52,7 +52,7 @@ interface Preset {
|
|
|
52
52
|
/** Model ID (e.g., "claude-sonnet-4-5") */
|
|
53
53
|
model?: string;
|
|
54
54
|
/** Thinking level */
|
|
55
|
-
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
55
|
+
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
56
56
|
/** Tools to enable (replaces default set) */
|
|
57
57
|
tools?: string[];
|
|
58
58
|
/** Instructions to append to system prompt */
|
|
@@ -100,7 +100,7 @@ function loadPresets(cwd: string): PresetsConfig {
|
|
|
100
100
|
|
|
101
101
|
interface OriginalState {
|
|
102
102
|
model: Model<Api> | undefined;
|
|
103
|
-
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
103
|
+
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
104
104
|
tools: string[];
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.29",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.81.
|
|
9
|
+
"version": "0.81.29",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|