@sayknow-cli/agent-core 0.3.16 → 0.4.1
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 +23 -0
- package/package.json +10 -11
- package/src/agent-loop.ts +826 -40
- package/src/agent.ts +260 -22
- package/src/compaction/compaction.ts +89 -95
- package/src/compaction/entries.ts +19 -0
- package/src/compaction/openai.ts +24 -30
- package/src/compaction/prompts/handoff-document.md +7 -0
- package/src/compaction/pruning.ts +144 -11
- package/src/proxy.ts +82 -2
- package/src/types.ts +106 -3
- package/dist/types/agent-loop.d.ts +0 -56
- package/dist/types/agent.d.ts +0 -403
- package/dist/types/append-only-context.d.ts +0 -137
- package/dist/types/compaction/branch-summarization.d.ts +0 -103
- package/dist/types/compaction/compaction.d.ts +0 -298
- package/dist/types/compaction/entries.d.ts +0 -109
- package/dist/types/compaction/errors.d.ts +0 -26
- package/dist/types/compaction/index.d.ts +0 -11
- package/dist/types/compaction/messages.d.ts +0 -61
- package/dist/types/compaction/openai.d.ts +0 -63
- package/dist/types/compaction/pruning.d.ts +0 -69
- package/dist/types/compaction/utils.d.ts +0 -32
- package/dist/types/compaction.d.ts +0 -1
- package/dist/types/harmony-leak.d.ts +0 -100
- package/dist/types/image-placeholder-guard.d.ts +0 -4
- package/dist/types/index.d.ts +0 -11
- package/dist/types/proxy.d.ts +0 -84
- package/dist/types/run-collector.d.ts +0 -196
- package/dist/types/telemetry.d.ts +0 -596
- package/dist/types/thinking.d.ts +0 -18
- package/dist/types/types.d.ts +0 -430
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.11.3] - 2026-07-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Pre-compaction pruning now preserves bounded, actionable error evidence instead of discarding it, while enforcing exact positive-savings admission and accounting so a prune is only applied when it demonstrably reduces context cost (#2635).
|
|
9
|
+
|
|
10
|
+
## [0.11.1] - 2026-07-16
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Hardened the managed fallback attempt snapshot: staged agent events and assistant partials were cloned with a bare `structuredClone`, so a single non-cloneable value in a staged payload (e.g. a live `Headers` inside `transportFailure`) threw `DataCloneError` ("The object can not be cloned."), masked the real provider outcome, and deterministically failed every attempt until the fallback chain exhausted. The snapshot now degrades to a cycle-aware sanitizing deep clone that always returns a detached, JSON-serializable value (unsupported leaves become placeholders), so event-time replay semantics are preserved and no local snapshot failure can masquerade as a provider attempt failure. Byte accounting in the provisional buffer measures the raw event before the snapshot duplicates it (over-limit payloads are rejected pre-clone), re-measures degraded snapshots so the retained sanitized form is what gets accounted, and uses the sanitized detached form as the cycle-safe estimator for cyclic payloads.
|
|
15
|
+
- Enforced the managed fallback authority boundary for local staging failures: `ManagedAttemptBufferOverflowError` no longer carries a synthetic provider-like `503` status, so exceeding the provisional event buffer limit (like any other local snapshot failure) is non-retryable, never converts into `transportFailure { kind: "transport", status: 503 }` evidence, and never rotates or consumes the model fallback chain — it surfaces as an explicit local error instead. Only original typed provider transport facts may authorize provider fallback.
|
|
16
|
+
- Added a bounded, neutralize-only `invalid_prompt` circuit breaker to the agent loop (#2282). A poisoned-history rejection (`Request blocked (code=invalid_prompt)`) is a deterministic content fault: re-sending the same history re-triggers it, so uncontrolled session auto-retry would burn its budget re-poisoning the model. On the first `invalid_prompt` of a run, leaked reserved control tokens are neutralized in place across history (no item is ever dropped). If that changes the outgoing bytes, the turn is resent exactly once with the repaired history; if neutralization cannot change anything, the run fails fast immediately with no resend. The repaired history is persisted for a clean resume, the breaker fires at most once per run (budget = one repaired resend), and it is scoped to the non-managed session path since managed fallback owns its own retry policy.
|
|
17
|
+
|
|
18
|
+
## [0.10.2] - 2026-07-14
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Extended the gpt-5.6 `Request blocked (code=invalid_prompt)` fix to the compaction paths that bypass the streaming transport. Remote OpenAI compaction (`/responses/compact`, `compaction.remoteEnabled` default on — the "remote compact task" in openai/codex#32028) built its native `input` from reasoning signatures, verbatim history items, and message/tool text without neutralizing leaked Harmony control-token markers (e.g. `<|channel|>analysis`), so gpt-5.6 rejected the compaction request and, on retry, could escalate to account-level blocking. `requestOpenAiRemoteCompaction` now neutralizes reserved control tokens across the whole outgoing `input`, and the generic `requestRemoteCompaction` prompt/systemPrompt are neutralized too. Local summarization was already covered by the streaming-transport request-boundary fix.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `AgentLoopConfig.maintainContext` now receives a required cancellation-aware lifecycle (`signal`, `awaitEventDrain(invocationSignal)`). Agent loops compose the run and maintenance-invocation signals and pass that single signal to EventStream's FIFO consumer-drain barrier, so cancellation removes the pending drain at its owner instead of racing an orphaned wait.
|
|
27
|
+
|
|
5
28
|
## [0.10.0] - 2026-07-12
|
|
6
29
|
|
|
7
30
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@sayknow-cli/agent-core",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"homepage": "https://sayknow-cli.com",
|
|
7
7
|
"author": "jaybeyond",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"state-management"
|
|
26
26
|
],
|
|
27
27
|
"main": "./src/index.ts",
|
|
28
|
-
"types": "./
|
|
28
|
+
"types": "./src/index.ts",
|
|
29
29
|
"scripts": {
|
|
30
30
|
"check": "biome check . && bun run check:types",
|
|
31
31
|
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"fmt": "biome format --write ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@sayknow-cli/ai": "0.
|
|
39
|
-
"@sayknow-cli/natives": "0.
|
|
40
|
-
"@sayknow-cli/utils": "0.
|
|
38
|
+
"@sayknow-cli/ai": "0.4.1",
|
|
39
|
+
"@sayknow-cli/natives": "0.4.1",
|
|
40
|
+
"@sayknow-cli/utils": "0.4.1",
|
|
41
41
|
"@opentelemetry/api": "^1.9.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -51,24 +51,23 @@
|
|
|
51
51
|
"files": [
|
|
52
52
|
"src",
|
|
53
53
|
"README.md",
|
|
54
|
-
"CHANGELOG.md"
|
|
55
|
-
"dist/types"
|
|
54
|
+
"CHANGELOG.md"
|
|
56
55
|
],
|
|
57
56
|
"exports": {
|
|
58
57
|
".": {
|
|
59
|
-
"types": "./
|
|
58
|
+
"types": "./src/index.ts",
|
|
60
59
|
"import": "./src/index.ts"
|
|
61
60
|
},
|
|
62
61
|
"./compaction": {
|
|
63
|
-
"types": "./
|
|
62
|
+
"types": "./src/compaction.ts",
|
|
64
63
|
"import": "./src/compaction.ts"
|
|
65
64
|
},
|
|
66
65
|
"./compaction/*": {
|
|
67
|
-
"types": "./
|
|
66
|
+
"types": "./src/compaction/*.ts",
|
|
68
67
|
"import": "./src/compaction/*.ts"
|
|
69
68
|
},
|
|
70
69
|
"./*": {
|
|
71
|
-
"types": "./
|
|
70
|
+
"types": "./src/*.ts",
|
|
72
71
|
"import": "./src/*.ts"
|
|
73
72
|
}
|
|
74
73
|
}
|