@sayknow-cli/agent-core 0.7.24 → 0.7.26

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [0.7.24] - 2026-11-13
5
+ ## [0.7.26] - 2026-11-24
6
6
 
7
7
  ## [0.7.22] - 2026-11-12
8
8
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@sayknow-cli/agent-core",
4
- "version": "0.7.24",
4
+ "version": "0.7.26",
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",
@@ -35,9 +35,9 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@sayknow-cli/ai": "0.7.24",
39
- "@sayknow-cli/natives": "0.7.24",
40
- "@sayknow-cli/utils": "0.7.24",
38
+ "@sayknow-cli/ai": "0.7.26",
39
+ "@sayknow-cli/natives": "0.7.26",
40
+ "@sayknow-cli/utils": "0.7.26",
41
41
  "@opentelemetry/api": "^1.9.0"
42
42
  },
43
43
  "devDependencies": {
@@ -72,6 +72,8 @@ export interface RemoteCompactionResponse {
72
72
  // OpenAI provider gating + endpoint resolution
73
73
  // ============================================================================
74
74
 
75
+ const CODEX_REMOTE_COMPACTION_TIMEOUT_MS = 60_000;
76
+
75
77
  export function shouldUseOpenAiRemoteCompaction(model: Model): boolean {
76
78
  return model.provider === "openai" || model.provider === "openai-codex";
77
79
  }
@@ -512,18 +514,32 @@ export async function requestOpenAiRemoteCompaction(
512
514
  headers[OPENAI_HEADERS.ORIGINATOR] = OPENAI_HEADER_VALUES.ORIGINATOR_CODEX;
513
515
  }
514
516
 
515
- const response = await fetch(endpoint, {
516
- method: "POST",
517
- headers,
518
- body: JSON.stringify(request),
519
- signal,
520
- });
521
-
522
- if (!response.ok) {
523
- throw new Error(`Remote compaction failed (${response.status} ${response.statusText})`);
517
+ const deadline =
518
+ model.provider === "openai-codex" ? AbortSignal.timeout(CODEX_REMOTE_COMPACTION_TIMEOUT_MS) : undefined;
519
+ const requestSignal = signal && deadline ? AbortSignal.any([signal, deadline]) : (signal ?? deadline);
520
+ let data: { output?: unknown } | undefined;
521
+ try {
522
+ const response = await fetch(endpoint, {
523
+ method: "POST",
524
+ headers,
525
+ body: JSON.stringify(request),
526
+ signal: requestSignal,
527
+ });
528
+ if (!response.ok) {
529
+ throw new Error(`Remote compaction failed (${response.status} ${response.statusText})`);
530
+ }
531
+ data = (await response.json()) as { output?: unknown } | undefined;
532
+ requestSignal?.throwIfAborted();
533
+ } catch (error) {
534
+ // Transport implementations can report a deadline as AbortError. Only
535
+ // caller cancellation should abort compaction rather than fall back.
536
+ if (!signal?.aborted && deadline?.aborted) {
537
+ throw new Error(`Codex remote compaction timed out after ${CODEX_REMOTE_COMPACTION_TIMEOUT_MS}ms`, {
538
+ cause: error,
539
+ });
540
+ }
541
+ throw error;
524
542
  }
525
-
526
- const data = (await response.json()) as { output?: unknown } | undefined;
527
543
  if (!Array.isArray(data?.output)) {
528
544
  throw new Error(`Remote compaction response malformed output (outputType=${typeof data?.output})`);
529
545
  }