@caupulican/pi-adaptative 0.81.0 → 0.81.2
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 +11 -0
- package/dist/core/agent-session.d.ts +5 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +58 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction-support.d.ts +9 -5
- package/dist/core/compaction-support.d.ts.map +1 -1
- package/dist/core/compaction-support.js +38 -27
- package/dist/core/compaction-support.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +4 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +6 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/settings-manager.d.ts +16 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +22 -0
- package/dist/core/settings-manager.js.map +1 -1
- 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/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 +12 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [0.81.2] - 2026-07-05
|
|
2
|
+
|
|
3
|
+
## [0.81.1] - 2026-07-05
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Phase-aware stream watchdog wiring in `AgentSession`, utilizing the new `StreamStallSettings` (`connectMs`, `activeIdleMs`, `quietIdleMs`) exposed and validated by `SettingsManager`.
|
|
7
|
+
- Compaction stream stalls are now fully retryable. Both manual and auto-compaction are wrapped in `_compactWithRetry`, ensuring transient stream stalls during summarization trigger retries rather than hard failures.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Increased `DEFAULT_HTTP_IDLE_TIMEOUT_MS` to 660s (from 120s) to support up to 10-minute quiet idles during long think phases without premature HTTP-layer kills.
|
|
1
11
|
## [0.81.0] - 2026-07-04
|
|
2
12
|
|
|
3
13
|
### Added
|
|
@@ -49,6 +59,7 @@
|
|
|
49
59
|
- The residual autonomy/session/runtime clusters moved out of `agent-session.ts` into eight new `core/` collaborator classes, bringing the file under the 4,000-line cap (5,387 → 3,963): `reflection-controller.ts` (`ReflectionController` — the native end-of-loop reflection pass, the isolated-completion primitive, and the gated learning-apply/rollback path), `goal-loop-controller.ts` (`GoalLoopController` — the bounded goal auto-continuation loop), `session-analytics.ts` (`SessionAnalytics` — usage/cost/stats accounting, the /context window estimate, and HTML/JSONL export, owning the spawned-usage and daily-usage memo caches), `session-tree-navigator.ts` (`SessionTreeNavigator` — in-file branch switching + fork-selector reads), `model-selection-controller.ts` (`ModelSelectionController` — the manual model switch/cycle and thinking-level set/cycle/clamp, distinct from the per-turn `ModelRouterController`), `bash-execution-controller.ts` (`BashExecutionController` — the `/bash` path and its streaming-deferred pending-message queue), `profile-filter-controller.ts` (`ProfileFilterController` — resource-profile tool/extension gating and reload-time profile model re-apply), and `tool-gate-controller.ts` (`ToolGateController` — the agent `beforeToolCall`/`afterToolCall` hooks: router escalation, autonomy gating, extension tool hooks, and the untrusted-content output boundary). `AgentSession` constructs each with narrow lazy accessor deps and keeps same-signature public delegations at every call-in point, so callers, the constructor dep closures, and the drive loop are untouched (the `model`/`thinkingLevel` getters, the branch-summary abort controller read by `isCompacting`, and the bash-flush call sites all stay host-side). The drive loop (`_promptUnserialized`/`_handleAgentEvent`/`_handlePostAgentRun`), compaction, the retry bridge, and the extension-core wiring stay host-side. Bodies are verbatim; behavior is unchanged.
|
|
50
60
|
|
|
51
61
|
### Fixed
|
|
62
|
+
- Default compaction model selection now respects the Model Router cheap model when enabled, otherwise falls back to the active session model with low reasoning instead of picking the globally cheapest authed model (which could route summarization through `openrouter/auto`).
|
|
52
63
|
- `pi --version` resolved through the full application import graph (~1s to print a version string). A fast path in the CLI entry now answers `--version`/`-v` from already-loaded config (~150ms, −85%); any combined invocation still routes through the full parser unchanged.
|
|
53
64
|
- Auto-compaction could fail or skip invisibly: three bail paths (no model, summarizer auth failure, nothing to compact) ended with no result and no reason, and the TUI rendered nothing for that combination — indistinguishable from broken compaction. Every auto-compaction outcome now carries a `result`, an `errorMessage`, or a new `skipReason` on `compaction_end`, and the TUI renders all of them. The cheap summarizer model (#30) also falls back to the session model when its key resolution fails at request time instead of silently giving up.
|
|
54
65
|
- `pi --help` had regressed from ~160ms to ~400ms: `config.ts`'s `normalizePath` import (needed
|
|
@@ -39,8 +39,9 @@ import type { ResourceProfileFilterSettings, SettingsManager } from "./settings-
|
|
|
39
39
|
import type { BashOperations } from "./tools/bash.ts";
|
|
40
40
|
/**
|
|
41
41
|
* Test hook: override the stream-idle bounds so a stall can be provoked in-suite without a
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* multi-minute wait. Pass `undefined` to restore the user-locked defaults (connect 120s /
|
|
43
|
+
* active 180s / quiet 600s, or the user's retry.stall settings). Applies per request — it
|
|
44
|
+
* may be set or changed at any time before the request that should observe it.
|
|
44
45
|
*/
|
|
45
46
|
export declare function setStreamIdleOptionsForTests(opts: Partial<StreamIdleOptions> | undefined): void;
|
|
46
47
|
/** Parsed skill block from a user message */
|
|
@@ -454,6 +455,7 @@ export declare class AgentSession {
|
|
|
454
455
|
private _getCompactionRequestAuth;
|
|
455
456
|
private _resolveCompactionModelAndAuth;
|
|
456
457
|
private _resolveCompactionModel;
|
|
458
|
+
private _resolveCompactionThinkingLevel;
|
|
457
459
|
/**
|
|
458
460
|
* Install tool hooks once on the Agent instance.
|
|
459
461
|
*
|
|
@@ -887,6 +889,7 @@ export declare class AgentSession {
|
|
|
887
889
|
private _checkContextWindowUsageWarning;
|
|
888
890
|
private _checkCompaction;
|
|
889
891
|
private _runAutoCompaction;
|
|
892
|
+
private _compactWithRetry;
|
|
890
893
|
/**
|
|
891
894
|
* Toggle auto-compaction setting.
|
|
892
895
|
*/
|