Commit Graph

18 Commits

Author SHA1 Message Date
can1357 2f54e760c1 feat(coding-agent): added async compaction and in-place handoff
- Added compaction.asyncEnabled (Async Compaction, default on): when
  context enters the pre-threshold band [threshold - lead, threshold)
  with lead = clamp(threshold * 0.125, 8192, 32000), maintenance
  speculatively summarizes in the background off a branch snapshot
  (first configured LLM-backed method: remote, handoff, or soft) using
  a side session id isolated from the live turn. Crossing the threshold
  splices the armed result in instantly instead of blocking on a
  summarization round-trip. Armed results are invalidated by branch
  changes, reset boundaries, model switches that strand provider-native
  replay payloads, and context growth past keepRecentTokens (which
  re-speculates); extensions registering session_before_compact keep
  exact blocking semantics (speculation disabled).
- Reworked handoff to commit in place: /handoff and the auto handoff
  method now write the generated document as a regular compaction entry
  on the current session (summary = document + <files> tag, cut from
  prepareCompaction) instead of starting a new session. SessionHandoff
  shrank to a document generator; session_before_switch/session_switch
  no longer fire with reason "handoff"; mid-turn maintenance no longer
  suppresses the handoff preference; overflow recovery can apply an
  armed handoff result.
- Extracted the shared auto-compaction commit tail
  (#commitAutoCompactionResult / #commitCompactionEntry) used by the
  blocking production path, the armed speculative apply, manual
  compaction, and manual handoff.
- Status line pulses the auto-compact icon while a speculation runs and
  holds it in accent once a result is armed.
- Exported remotePreserveReusable from pi-agent-core/compaction for
  apply-time validation of speculative remote results.
2026-08-20 03:46:34 +02:00
can1357 8c35861d96 feat(coding-agent): implemented ordered compaction fallback and settings
- Replaced legacy `compaction.strategy` and `remoteEnabled` settings with `compaction.methodOrder` across session maintenance, schema, and tests.
- Added automatic fallback mechanism to try subsequent compaction methods upon failure or unsupported model capabilities.
- Added mouse drag-and-drop reordering support and click handlers to multi-select settings submenus.
- Updated documentation and test suites to reflect ordered compaction strategy preferences and fallback chains.
2026-08-20 02:59:49 +02:00
can1357 f901273918 fix(coding-agent): detached mid-run lifecycle handlers fully 2026-08-16 02:13:37 +02:00
Valentin De Matos 8344a0e823 fix: stop mid-run compaction from awaiting lifecycle emits
Detached auto-compaction start/end (and shake) so a hung
auto_compaction_end handler cannot pin the next provider call.
2026-08-14 19:45:33 -07:00
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
Ethan Cawse a224dedc0d test(coding-agent): bound message-end isolation regression 2026-08-12 10:54:39 -04:00
Ethan Cawse 7b0d12ee63 fix(coding-agent): detach noncloneable message metadata 2026-08-11 23:20:41 -04:00
Ethan Cawse 92f0ad71f4 docs(coding-agent): define message-end isolation 2026-08-11 23:05:59 -04:00
Ethan Cawse 7ab6b554f6 fix(coding-agent): isolate message-end notifications 2026-08-11 23:03:11 -04:00
Ethan Cawse a457173750 fix(coding-agent): preserve persistence after listener failures 2026-08-11 23:03:10 -04:00
Ethan Cawse 94b865be6f fix(coding-agent): skip idle mid-turn persistence waits 2026-08-11 23:03:10 -04:00
can1357 e49f8f4fb2 test(coding-agent): added shared auth storage and model registry to tests
- Added shared auth storage and model registry for concurrent and eager compaction tests.
- Replaced per-test auth storage creation and cleanup routines with shared lifecycle management.
- Removed local auth storage variables and individual cleanup hooks from test harness instances.
2026-08-12 03:25:31 +02:00
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00
can1357 3aa47d2ab9 fix(coding-agent): matched persisted messages by key identity during mid-run compaction
- Replaced the map-based persisted message index with a Set of key identities.
- Removed the message content equality check during branch verification to avoid false out-of-order skips when display-side content variants are present.
2026-06-30 17:44:09 +02:00
Alexander Kirilin d2b6bde571 fix(agent): preserve mid-turn tool persistence order 2026-06-26 10:57:36 -04:00
Alexander Kirilin ab513757f8 fix(agent): preserve tool turn before mid-run compaction 2026-06-26 09:35:24 -04:00
Alexander Kirilin bbe3d98375 fix(agent): compact long tool loops mid-turn
Co-authored-by: coderred <coderredlab@gmail.com>
2026-06-26 09:05:11 -04:00
roboomp a305e68a53 fix(compaction): compact goal runs between tool turns
Active goal loops can stay inside one agent run while the model keeps
emitting tool calls, so the normal agent_end threshold maintenance never
runs. That lets context grow past the soft threshold until provider
overflow or user abort.

Run threshold maintenance from the per-turn onTurnEnd hook for active
goals, splice the compacted agent state back into the live loop message
array, and suppress queued continuations because the current run is
already continuing. Cover the mid-run tool-call path and the non-goal
control case.

Refs #3174
2026-06-22 20:02:33 +00:00