Commit Graph

4781 Commits

Author SHA1 Message Date
Your Name 26602f97fb fix(core): Resolve context loss and token calculator thrashing
This commit addresses the massive context loss and 0% utilization issue by fixing two related bugs in the context management system:

1.  **Masked Tool Retention Bug:** Removed the brittle 'in-flight' protection logic from `getProtectedNodeIds`. Previously, this logic failed to match `MASKED_TOOL` nodes, causing it to perpetually hoard `functionCall` nodes inside the protected list. This hoarding rapidly exhausted the context budget, forcing the GC backstop into an aggressive death spiral. Now, only the `recent_turn` and explicit tasks are protected, allowing standard GC to naturally prune old tool calls (and the `HistoryHardener` handles the rest).
2.  **Adaptive Calculator Overhead Bug:** The `AdaptiveTokenCalculator` was calculating ratio drift by dividing the API's `actualTokens` (which includes the static overhead of the System Instruction and Tools) by the graph's `baseUnits` (which only counts history). We now inject an `getOverheadTokens` callback during initialization, allowing the calculator to subtract the overhead from the Gemini API count before dividing by the base units, achieving an accurate apples-to-apples ratio.
3.  **Violent Oscillation Dampening:** Introduced strict dampening bounds (`maxStep` limit and a hard `targetWeight` clamp) to the Adaptive Token Calculator's EMA. This acts identically to a machine learning learning-rate limit, ensuring that a single massive outlier reading cannot violently thrash the `learnedWeight` multiplier in a single turn.

Includes new test coverage verifying the maxStep logic and overhead subtraction. Also removed an unsafe `as unknown` cast in the `snapshotGenerator` that failed `eslint`.
2026-05-14 23:56:16 +00:00
Your Name 665b5ca6c7 fix issue with missing function responses 2026-05-14 23:13:01 +00:00
Your Name 5e34ea4be3 fix(context): properly re-identify snapshot nodes when loaded from disk
When PR cdd482c2e reverted structural snapshot rehydration, it left
toGraph mapping all non-tool parts as NodeType.USER_PROMPT. This caused
findLatestSnapshotBaseline to fail on resumed sessions, starting the Master
State from an empty baseline and leading to catastrophic data loss.
This fix detects the snapshot signature during graph construction to
properly assign NodeType.SNAPSHOT.
2026-05-14 23:10:19 +00:00
Your Name eee1fda092 better testing 2026-05-14 18:12:58 +00:00
Your Name a31aa6094f tidying 2026-05-14 04:58:17 +00:00
Your Name cc3b17a32f managed history imporvements 2026-05-14 04:40:49 +00:00
Your Name c7ba026c18 strong owner 2026-05-14 04:40:49 +00:00
Your Name d0032c6749 refactor(context): implement durable NodeIdService and stabilize tool IDs 2026-05-14 04:40:49 +00:00
Your Name 4f6186f6f1 refactor(context): implement commit-on-render strategy for GC backstop 2026-05-14 04:40:48 +00:00
Your Name 0214e3fc77 fix(context): fix accidental mutation in snapshotGenerator 2026-05-14 04:40:48 +00:00
Your Name ac49195b37 test(context): add unit tests for snapshot ID flattening 2026-05-14 04:40:48 +00:00
Your Name 9a353ae1f8 fix(context): revert restored snapshot type to accumulate 2026-05-14 04:40:48 +00:00
Your Name 2a2834cb77 fix(context): address PR feedback on state persistence and snapshot rehydration 2026-05-14 04:40:48 +00:00
Your Name 56aa3855d1 fix(test): use stdin for massive payload to avoid Windows ENAMETOOLONG and fix typecheck errors 2026-05-14 04:40:48 +00:00
Your Name bbff78de67 refactor(context): merge non-strict logic back into FakeContentGenerator 2026-05-14 04:40:48 +00:00
Your Name c467b26d01 chore(context): polish toGraph determinism and fix part type coverage 2026-05-14 04:40:48 +00:00
Your Name 78a0e5d457 chore(context): remove dead initialization trigger and unawaited promise 2026-05-14 04:40:47 +00:00
Your Name cdd482c2e0 fix(context): revert structural snapshot rehydration and rely on baseline gc 2026-05-14 04:40:47 +00:00
Your Name 65d4bdfc24 feat(context): persist context engine snapshots across sessions
This commit implements an opaque state export/import pattern for the
ContextManager to ensure expensive LLM-derived snapshots are properly
rehydrated upon session resume.

The ContextManager now exposes `exportState` and `restoreState` methods,
delegating structural validation to the `SnapshotStateHelper`.
During active chat, the GeminiClient routinely passes the finalized
context state down to the ChatRecordingService, which seamlessly
embeds it into the existing JSONL metadata payload. Upon resume, the
saved snapshot is re-published as a draft to the LiveInbox, allowing
the synchronous pipeline to automatically and deterministically splice
it back into the raw graph without an additional LLM call.
2026-05-14 04:40:47 +00:00
Spencer 488d71b8c9 feat(core): expose RAG snippets to local log file for debugging (#27016) 2026-05-14 02:34:12 +00:00
Gal Zahavi 77078b3e8a fix(core): ensure stable fallback for restricted preview models (#26999) 2026-05-13 21:46:41 +00:00
ifitisit 1814c7f358 fix(cli): don't crash when an @-mention captures a non-path blob (#25980) 2026-05-13 21:43:08 +00:00
EMERSON BUSSON 724981baf8 fix(core): throttle shell text output and bound live UI buffer (#26955) 2026-05-13 21:34:32 +00:00
Sandy Tao 7504259d72 chore: clean up launched memory features (#26941)
Co-authored-by: Jenna Inouye <jinouye@google.com>
2026-05-13 21:22:56 +00:00
Coco Sheng 0750b01fe4 fix: add system PATH fallback for ripgrep resolution (#26777) (#26868) 2026-05-13 21:05:37 +00:00
Dev Randalpura 41599ce29f fix(core): made context files append instead of replace (#26950)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-05-13 19:45:30 +00:00
AK 9da30b8831 fix(core): isolate subagent thread context (#26449) 2026-05-13 18:55:17 +00:00
Dev Randalpura 71a2c0264e fix(ui): clamped table column widths (#26991)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-05-13 18:43:49 +00:00
Sahil Kirad fd01cc03bf fix(core): refresh MCP OAuth token usage after re-auth (#26312)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2026-05-13 12:01:27 -07:00
Coco Sheng 08abe4542d fix(cli): auto-approve shell redirections in AUTO_EDIT mode (#27003) 2026-05-13 18:28:30 +00:00
Coco Sheng 63b4bbfb5d fix(core): handle EISDIR on virtual drives in memory discovery (#26985) 2026-05-13 17:41:49 +00:00
Coco Sheng 1e7063bb0b fix(cli): allow keychain auth for --list-sessions and non-interactive mode (#26921) 2026-05-13 17:35:21 +00:00
Coco Sheng 297d3a3067 fix(core): preserve OAuth refresh tokens during rotation and retrieval (#26924) 2026-05-13 17:19:05 +00:00
David Pierce 749657cbf9 feat(cli): merge Auto modes into a single Auto mode (#26714) 2026-05-13 16:55:43 +00:00
Adam Weidman 8cda688fe2 feat(core): change agent registration to first-wins and prioritize project (#26953) 2026-05-13 01:33:12 +00:00
mahadevan 31d5947d37 Refactor: Eliminate no-unsafe-return suppressions via strict type validation (#20668)
Signed-off-by: M-DEV-1 <mahadevankizhakkedathu@gmail.com>
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2026-05-12 23:45:58 +00:00
gemini-cli-robot 583839ba46 chore(release): bump version to 0.44.0-nightly.20260512.g022e8baef (#26957) 2026-05-12 22:44:04 +00:00
Coco Sheng 120dfc724d fix(core): update read_file schema for v1 compatibility (#22183) (#26922) 2026-05-12 21:41:49 +00:00
Dev Randalpura c37b9113d7 fix(ui): fixed line wrap padding for selection lists (#26944) 2026-05-12 21:24:40 +00:00
Adam Weidman c987b99394 refactor(core): introduce SubagentState enum for progress (#26934) 2026-05-12 18:58:25 +00:00
kevinjwang1 27a39b04b0 Enable NumericalRouter when using dynamic model configs (#26929) 2026-05-12 18:06:21 +00:00
Sandy Tao ebe15553a9 Exclude extension context from skill extraction agent (#26879) 2026-05-12 10:45:19 -07:00
Yulong Wu bc730b2c0f fix (telemetry): inject quota_project_id to prevent fallback to default oauth client (#26698)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2026-05-12 17:02:15 +00:00
joshualitt 07792f98cd feat(context): Introduce adaptive token calculator to more accurately calculate content sizes. (#26888) 2026-05-12 15:51:20 +00:00
Coco Sheng 7a9ed4c20a fix: respect explicit model selection after Flash quota exhaustion (#26759) (#26872) 2026-05-12 14:26:50 +00:00
Kuroda Kayn 11a9edc808 fix(cli): restore resume for legacy sessions (#26577)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2026-05-12 00:28:47 +00:00
Adam Weidman 24b98ade86 fix(cli): enable adk non-interactive session (#26895) 2026-05-11 23:38:23 +00:00
Eswar809 9f759f97a2 fix(core): ignore .pak and .rpa game archive formats by default (#26884)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2026-05-11 21:58:08 +00:00
Franco Pieri 9ff7304391 Allow Enter to select session while in search mode in /resume (#21523)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2026-05-11 21:46:00 +00:00
Daniel Weis e1b3ce5b36 revert 6b9b778d82 (#26893) 2026-05-11 21:07:54 +00:00