18 Commits

Author SHA1 Message Date
Alexander Davydov
fb08d4e434 GigaChat: avoid stale auth metadata fallback 2026-03-20 13:54:09 +03:00
Alexander Davydov
d6daa108e3 GigaChat: preserve config and runtime fallbacks 2026-03-18 23:23:12 +03:00
Alexander Davydov
1ad4fc4354 Merge remote-tracking branch 'upstream/main' into feat/gigachat
# Conflicts:
#	package.json
#	src/agents/pi-embedded-runner/compact.hooks.test.ts
#	src/commands/onboard-auth.config-core.ts
#	src/commands/onboard-auth.models.ts
#	src/commands/onboard-auth.ts
#	src/commands/onboard-non-interactive/local/auth-choice.api-key-providers.ts
#	src/plugins/provider-auth-storage.ts
2026-03-18 12:25:31 +03:00
Alexander Davydov
1f5a3933c8 GigaChat: use resolved profile metadata in compaction 2026-03-17 17:10:25 +03:00
Josh Lehman
eeb140b4f0
fix(plugins): late-binding subagent runtime for non-gateway load paths (#46648)
Merged via squash.

Prepared head SHA: 44742652c9ac2eec82a6d958fd77f84ba1d29c0a
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-16 14:27:54 -07:00
Alexander Davydov
78593ccf84 Agents: wire GigaChat compaction stream 2026-03-16 17:57:32 +03:00
Jason
f77a684131
feat: make compaction timeout configurable via agents.defaults.compaction.timeoutSeconds (#46889)
* feat: make compaction timeout configurable via agents.defaults.compaction.timeoutSeconds

The hardcoded 5-minute (300s) compaction timeout causes large sessions
to enter a death spiral where compaction repeatedly fails and the
session grows indefinitely. This adds agents.defaults.compaction.timeoutSeconds
to allow operators to override the compaction safety timeout.

Default raised to 900s (15min) which is sufficient for sessions up to
~400k tokens. The resolved timeout is also used for the session write
lock duration so locks don't expire before compaction completes.

Fixes #38233

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add resolveCompactionTimeoutMs tests

Cover config resolution edge cases: undefined config, missing
compaction section, valid seconds, fractional values, zero,
negative, NaN, and Infinity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add timeoutSeconds to compaction Zod schema

The compaction object schema uses .strict(), so setting the new
timeoutSeconds config option would fail validation at startup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: enforce integer constraint on compaction timeoutSeconds schema

Prevents sub-second values like 0.5 which would floor to 0ms and
cause immediate compaction timeout. Matches pattern of other
integer timeout fields in the schema.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: clamp compaction timeout to Node timer-safe maximum

Values above ~2.1B ms overflow Node's setTimeout to 1ms, causing
immediate timeout. Clamp to MAX_SAFE_TIMEOUT_MS matching the
pattern in agents/timeout.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add FIELD_LABELS entry for compaction timeoutSeconds

Maintains label/help parity invariant enforced by
schema.help.quality.test.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: align compaction timeouts with abort handling

* fix: land compaction timeout handling (#46889) (thanks @asyncjason)

---------

Co-authored-by: Jason Separovic <jason@wilma.dog>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-15 12:04:48 +05:30
Peter Steinberger
e794417623 fix: resolve current ci regressions 2026-03-14 00:51:12 +00:00
Peter Steinberger
91b9c47dad test: share embedded compaction hook helpers 2026-03-14 00:30:14 +00:00
Peter Steinberger
df2bda63c6 refactor: share compact hook success harness 2026-03-13 20:19:39 +00:00
Efe Büken
771066d122
fix(compaction): use full-session token count for post-compaction sanity check (#28347)
Merged via squash.

Prepared head SHA: cf4eab1c51e6b8890e23c2d7172313c40cd2fe04
Co-authored-by: efe-arv <259833796+efe-arv@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-12 21:26:30 -07:00
Rodrigo Uroz
143e593ab8
Compaction Runner: wire post-compaction memory sync (#25561)
Merged via squash.

Prepared head SHA: 6d2bc02cc16429a19b041acd353c08dd2404335f
Co-authored-by: rodrigouroz <384037+rodrigouroz@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-12 14:24:29 -07:00
Rodrigo Uroz
688e3f0863 Compaction Runner: emit transcript updates post-compact (#25558)
Merged via squash.

Prepared head SHA: 8a858436ed31805124a9d096bd93ab90e5423672
Co-authored-by: rodrigouroz <384037+rodrigouroz@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-12 08:22:12 -07:00
David Rudduck
f01c41b27a
fix(context-engine): guard compact() throw + fire hooks for ownsCompaction engines (#41361)
Merged via squash.

Prepared head SHA: 0957b32dc63b16d710403565953b77bfbd2bd987
Co-authored-by: davidrudduck <47308254+davidrudduck@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-11 20:19:20 -07:00
Peter Steinberger
661af2acd3 fix(agents): bootstrap runtime plugins before context-engine resolution 2026-03-08 23:38:38 +00:00
Vincent Koc
7e946b3c6c
fix(ollama): register custom api for compaction and summarization (#39332)
* fix(agents): add custom api registry helper

* fix(ollama): register native api for embedded runs

* fix(ollama): register custom api before compaction

* fix(tts): register custom api before summarization

* changelog: note ollama compaction registration fix

* fix(ollama): honor resolved base urls in custom api paths
2026-03-07 17:40:34 -08:00
Peter Steinberger
537c97cce9 fix(agents): apply contextTokens cap for compaction threshold (#39099)
Land #39099 by @MumuTW.

Co-authored-by: MumuTW <clothl47364@gmail.com>
2026-03-07 19:19:03 +00:00
Vincent Koc
71ec42127d
feat(hooks): emit compaction lifecycle hooks (#16788) 2026-03-05 19:08:26 -08:00