Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1d26e73
refactor(core,cli): rename Gemini residue in memory/spinner/leaf ids
yiliang114 Aug 24, 2026
305123e
fix(cli): resolve rename build failure
yiliang114 Aug 24, 2026
67dd620
docs(serve): fix memory filename references
yiliang114 Aug 24, 2026
082c2c9
Merge remote-tracking branch 'origin/main' into HEAD
yiliang114 Aug 24, 2026
ed97f92
test(cli): pin primary workspace QWEN.md init fallback
yiliang114 Aug 24, 2026
8b1d775
refactor(core,cli): finish Gemini residue rename in memoryDiscovery
yiliang114 Aug 24, 2026
139e1ef
docs(design): route loadHierarchicalGeminiMemory to Memory naming
yiliang114 Aug 24, 2026
094e2c6
docs(cli): narrow extractContextFilename fallback description
yiliang114 Aug 24, 2026
aceb664
refactor(cli): rename loadHierarchicalGeminiMemory to loadHierarchica…
yiliang114 Aug 24, 2026
2c53c53
fix(core): preserve Gemini rename compatibility
yiliang114 Aug 26, 2026
74bf792
docs(core): extend Gemini deprecation window
yiliang114 Aug 26, 2026
bd93701
refactor(core,cli): rename Gemini LLM identifiers
yiliang114 Aug 26, 2026
732db26
Merge remote-tracking branch 'origin/main' into 4063-rename-residue
yiliang114 Aug 26, 2026
b397fff
Merge remote-tracking branch 'origin/4063-rename-residue' into codex/…
yiliang114 Aug 26, 2026
4842cf7
fix(core): retain Gemini content generator aliases
yiliang114 Aug 26, 2026
4710d69
docs(core): document legacy content generator paths
yiliang114 Aug 26, 2026
01dc363
chore: merge main into core LLM rename
yiliang114 Aug 27, 2026
630ccf4
Merge remote-tracking branch 'origin/main' into codex/4063-rename-cor…
yiliang114 Aug 27, 2026
44352b9
ci: trigger checks after retargeting to main
yiliang114 Aug 27, 2026
7ac8e06
test(cli): update renamed LLM expectations
yiliang114 Aug 27, 2026
2605d6b
Merge branch 'main' into codex/4063-rename-core-llm
qwen-code-dev-bot Aug 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/design/2026-08-22-rename-gemini-fork-residue.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ Non-test files; `gemini-converter.ts` is intentionally NOT renamed (see above).
| `packages/core/src/core/geminiContentGenerator/index.ts` | `packages/core/src/core/llm-content-generator/index.ts` |
| `packages/core/src/core/geminiRequest.ts` | `packages/core/src/core/llm-request.ts` |

The old `geminiRequest.ts` path remains as a deprecated re-export shim until a
The old `geminiRequest.ts`, `geminiChat.ts`, and
`geminiContentGenerator/` paths remain as deprecated re-export shims until a
future major release.

## Phasing
Expand Down Expand Up @@ -133,6 +134,9 @@ move as one atomic PR.
- Stream layer: `useGeminiStream` → `useLlmStream` (`use-llm-stream.ts`),
`gemini.tsx` → `llm.tsx`.
- Protocol converters: `convert*ToGemini*` / `convertGemini*To*` → `Llm`.
- Deprecated compatibility aliases for the published core classes, event
types, `Config` client access/initialization option, and old chat and content
generator module paths.

## Risks

Expand All @@ -158,5 +162,5 @@ move as one atomic PR.
- `cd packages/cli && npx tsc --noEmit`
- Targeted unit tests per renamed module
- Legacy-name grep results are confined to the documented compatibility aliases
and `geminiRequest.ts` shim; active repository consumers use the new names.
and re-export shims; active repository consumers use the new names.
- `npm run lint` (kebab-case filenames are enforced)
60 changes: 30 additions & 30 deletions docs/design/auto-memory/acp-managed-auto-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Dream scheduled once after a complete, successful logical user turn.

This design deliberately does **not** add a new coordinator class. Every ACP
`Session` already has a per-session `Config`, and that `Config` already owns one
`GeminiClient`. The `GeminiClient` is therefore the existing correct owner for
`LlmClient`. The `LlmClient` is therefore the existing correct owner for
the pending Recall handle, surfaced-document deduplication, recent-tool context,
cancellation, and Recall delivery telemetry. The ACP `Session` calls a small
public lifecycle API on that existing object.
Expand All @@ -37,7 +37,7 @@ older tree and then mechanically applied to the target.

At the target baseline:

- `GeminiClient.sendMessageStream()` owns the complete managed Recall state
- `LlmClient.sendMessageStream()` owns the complete managed Recall state
machine.
- A fresh interactive `UserQuery` starts Recall after `UserPromptSubmit` has
allowed the request, but queries with the original pre-hook prompt text.
Expand All @@ -48,13 +48,13 @@ At the target baseline:
delivered by the fast phase are removed before refined delivery.
- Pending Recall is cancelled on a new query, parent abort, reset, shutdown, or
a turn with no later safe delivery point.
- `GeminiClient` tracks surfaced memory paths for session-level deduplication and
- `LlmClient` tracks surfaced memory paths for session-level deduplication and
recent completed tool names for Recall relevance filtering.
- Extract and Dream are implemented and guarded by `MemoryManager`; their
cursor, trailing-request merge, locks, pressure gates, and Dream thresholds do
not depend on the UI.

ACP bypasses the orchestration above by calling `GeminiChat.sendMessageStream()`
ACP bypasses the orchestration above by calling `LlmChat.sendMessageStream()`
from `Session.#sendMessageStreamWithAutoCompression()`. The comment above
`Session.#buildInitialSystemReminders()` explicitly records that managed Recall
is absent. ACP also never schedules Extract or Dream after its complete tool and
Expand All @@ -79,7 +79,7 @@ algorithm.

- Reimplementing Recall, Extract, or Dream in ACP, a hook, a sidecar, or a proxy.
- Adding an ACP method or notification for memory task progress.
- Refactoring all `GeminiClient` background work, including auto-skill, into a
- Refactoring all `LlmClient` background work, including auto-skill, into a
new shared scheduler.
- Changing memory paths, workspace scoping, file formats, settings defaults, or
Dream thresholds.
Expand All @@ -94,14 +94,14 @@ algorithm.

## Ownership

| Concern | Owner | Reason |
| -------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------- |
| Pending Recall promise and abort controller | Per-session `GeminiClient` | It already owns this state for interactive turns and is shared by the ACP `Session`. |
| Fast/refined arbitration, surfaced-path dedup, telemetry | Per-session `GeminiClient` | These invariants must not be copied into ACP. |
| Fresh/retry/continue/runtime turn classification | ACP `Session` | Only `Session` knows ACP admission metadata and Goal origin. |
| ToolResult provider-send ordering | ACP `Session` | It owns the autonomous tool loop and final outgoing `Part[]`. |
| Successful logical-turn completion | ACP `Session` | It alone spans model calls, tools, mid-turn input, Stop hooks, and todo-stop continuations. |
| Extract/Dream jobs and durable state | Existing `MemoryManager` | It already owns cursors, merging, locks, gates, and task records. |
| Concern | Owner | Reason |
| -------------------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------- |
| Pending Recall promise and abort controller | Per-session `LlmClient` | It already owns this state for interactive turns and is shared by the ACP `Session`. |
| Fast/refined arbitration, surfaced-path dedup, telemetry | Per-session `LlmClient` | These invariants must not be copied into ACP. |
| Fresh/retry/continue/runtime turn classification | ACP `Session` | Only `Session` knows ACP admission metadata and Goal origin. |
| ToolResult provider-send ordering | ACP `Session` | It owns the autonomous tool loop and final outgoing `Part[]`. |
| Successful logical-turn completion | ACP `Session` | It alone spans model calls, tools, mid-turn input, Stop hooks, and todo-stop continuations. |
| Extract/Dream jobs and durable state | Existing `MemoryManager` | It already owns cursors, merging, locks, gates, and task records. |

This ownership split avoids both bad extremes: copying the Recall state machine
into `Session.ts`, and introducing a general coordinator that would merely wrap
Expand Down Expand Up @@ -157,10 +157,10 @@ they need no extra flags.

## Design

### 1. Expose the existing Recall lifecycle on `GeminiClient`
### 1. Expose the existing Recall lifecycle on `LlmClient`

Extract the current inline/private orchestration into three public methods on
the already-exported `GeminiClient`:
the already-exported `LlmClient`:

```ts
beginManagedAutoMemoryRecall(query: string, signal: AbortSignal): void;
Expand Down Expand Up @@ -192,15 +192,15 @@ The current lower-level helper may remain private so the interactive Cron path
can retain its existing zero-wait initial poll. No wait constant or new Recall
type is exported.

`GeminiClient.sendMessageStream()` is migrated to these methods in the same
`LlmClient.sendMessageStream()` is migrated to these methods in the same
change, so the interactive path continues to exercise the shared API. Existing
Recall tests then protect both callers instead of leaving the new public path
ACP-only and weakly tested.

The complete downstream consumer list for the new methods is intentionally
small. It consists of three owning methods:

1. `GeminiClient.sendMessageStream()` for interactive/headless UserQuery and
1. `LlmClient.sendMessageStream()` for interactive/headless UserQuery and
ToolResult sends.
2. `Session.#executePromptInner()` for ACP begin, initial consume, and final
cleanup.
Expand All @@ -223,7 +223,7 @@ In `Session.#executePromptInner()`:

```ts
this.config
.getGeminiClient()
.getLlmClient()
.beginManagedAutoMemoryRecall(promptText, pendingSend.signal);
```

Expand All @@ -242,7 +242,7 @@ consume the initial result:

```ts
const memory = await this.config
.getGeminiClient()
.getLlmClient()
.consumeManagedAutoMemoryRecall('initial');

if (memory?.prompt) {
Expand Down Expand Up @@ -275,7 +275,7 @@ Instead, extend `Session.#sendMessageStreamWithAutoCompression()` after all of
its explicit send-drop gates have passed: `prepareBeforeCompression`, automatic
compression, the session-token limit, the compression diagnostic,
`beforeSend`, and the final abort check. Immediately before constructing the
request and calling `GeminiChat.sendMessageStream()`:
request and calling `LlmChat.sendMessageStream()`:

1. Detect that the outgoing message starts with one or more
`functionResponse` parts.
Expand Down Expand Up @@ -369,7 +369,7 @@ void memoryManager
```

Do not await either task and do not store their promises in
`GeminiClient.pendingMemoryTaskPromises`; ACP has no TUI `memory_saved` item to
`LlmClient.pendingMemoryTaskPromises`; ACP has no TUI `memory_saved` item to
consume that queue. `MemoryManager` already tracks the work. The two rejection
handlers are required to prevent unhandled background rejections, not to add a
fallback path.
Expand All @@ -381,13 +381,13 @@ turn. Tool and Stop-hook continuations never pass that callsite independently.
### 7. Feed existing recent-tool state from ACP

ACP currently executes tools without calling the already-public
`GeminiClient.recordCompletedToolCall()`. Use `Session.runTool()`'s existing
`LlmClient.recordCompletedToolCall()`. Use `Session.runTool()`'s existing
outer `finally`, where `terminalStatus` and the effective `args` are already
known, to call it once when a registered tool reaches a non-cancelled terminal
state:

```ts
this.config.getGeminiClient().recordCompletedToolCall(toolName, args);
this.config.getLlmClient().recordCompletedToolCall(toolName, args);
```

This keeps Recall's recent-tool noise filter aligned with interactive sessions.
Expand All @@ -406,7 +406,7 @@ auto-skill behavior.
sequenceDiagram
participant C as ACP client
participant S as ACP Session
participant G as GeminiClient Recall owner
participant G as LlmClient Recall owner
participant M as MemoryManager
participant L as Main model

Expand Down Expand Up @@ -551,23 +551,23 @@ The implementation is complete only if all of these hold:

### New `ManagedMemoryTurnCoordinator` class

Rejected for this PR. It would move the same fields out of `GeminiClient`, add a
Rejected for this PR. It would move the same fields out of `LlmClient`, add a
new exported entity, and force constructor/lifecycle plumbing even though ACP
already shares the exact `GeminiClient` instance. Public lifecycle methods on the
already shares the exact `LlmClient` instance. Public lifecycle methods on the
existing state owner provide reuse with a smaller proof surface.

A standalone coordinator becomes justified only if a future runtime does not
own a `GeminiClient` but still needs the same Recall state machine.
own a `LlmClient` but still needs the same Recall state machine.

### Copy Recall state into `Session.ts`

Rejected. It duplicates fast/refined arbitration, path deduplication,
cancellation listeners, terminal telemetry, and every future Recall change.

### Put all post-turn scheduling in `GeminiClient`
### Put all post-turn scheduling in `LlmClient`

Rejected. ACP has the authoritative complete-turn boundary, while
`GeminiClient.sendMessageStream()` is a physical model-send boundary in
`LlmClient.sendMessageStream()` is a physical model-send boundary in
interactive flows. Forcing ACP to call the interactive background-task method
would also enqueue TUI-only notification promises and couple this change to
auto-skill scheduling.
Expand Down Expand Up @@ -606,7 +606,7 @@ The ACP/WebSocket proxy remains transport-only and requires no memory logic.

1. Rebase the fork branch onto target baseline `43d46be` or a newer upstream
commit and re-check the named symbols.
2. Refactor `GeminiClient` Recall into the public lifecycle methods with no
2. Refactor `LlmClient` Recall into the public lifecycle methods with no
behavior change; run the core tests.
3. Add ACP begin/initial/refined/finalize wiring and focused Session tests.
4. Add exactly-once Extract/Dream scheduling and recent-tool recording tests.
Expand Down
4 changes: 2 additions & 2 deletions docs/developers/daemon/20-quickstart-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ qwen serve
packages/cli/index.ts main()
|
v
gemini.tsx main() - parseArguments()
llm.tsx main() - parseArguments()
|
v (yargs assembly)
config/config.ts import { serveCommand } ...
Expand Down Expand Up @@ -276,7 +276,7 @@ Key facts:

- **`createServeApp` only builds; it does not listen.** It returns an `express()` instance with middleware and routes mounted. Ordinary-only embedders may continue to own `app.listen()`. Embedders that use Live/Conversations must bind the actual Node server to the exported app lifecycle before listening and await that lifecycle during shutdown.
- **`() => actualPort` is a lazy closure.** `actualPort` is assigned in the `server.listen` callback. The `hostAllowlist` middleware reads it on demand, so ephemeral ports (`--port 0`) still gate the `Host` header correctly.
- **`await blockForever()` is intentional.** If `yargs.parse()` resolves, the CLI top level falls through into the interactive TUI entrypoint (`gemini.tsx`). SIGINT / SIGTERM exit through `runQwenServe`'s `onSignal` path.
- **`await blockForever()` is intentional.** If `yargs.parse()` resolves, the CLI top level falls through into the interactive TUI entrypoint (`llm.tsx`). SIGINT / SIGTERM exit through `runQwenServe`'s `onSignal` path.

## 10. HTTP route file split

Expand Down
8 changes: 4 additions & 4 deletions docs/e2e-tests/2026-05-19-oom-reproduction-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ history 足够大时会产生峰值放大,需要再用默认 heap 长任务验

### 关键配置修改

`packages/core/src/core/geminiChat.ts` 中将 heap-pressure compaction 阈值从 0.7 改为 99.0(使其永远不触发),模拟 #4186 修复前的状态。
`packages/core/src/core/llm-chat.ts` 中将 heap-pressure compaction 阈值从 0.7 改为 99.0(使其永远不触发),模拟 #4186 修复前的状态。

---

Expand All @@ -63,7 +63,7 @@ history 足够大时会产生峰值放大,需要再用默认 heap 长任务验
### 崩溃时间线

```
[21:26:59] #1 RSS:193.6MB Ctx:0% → Read geminiChat.ts (1500 行)
[21:26:59] #1 RSS:193.6MB Ctx:0% → Read llm-chat.ts (1500 行)
[21:27:46] #2 RSS:270.4MB Ctx:4.2% → Read agent.ts
[21:28:32] #3 RSS:397.5MB Ctx:4.3% → grep + Read 3 个文件
[21:29:18] #4 RSS:452.7MB Ctx:5.7% → Read slashCommandProcessor.ts
Expand Down Expand Up @@ -363,7 +363,7 @@ sendMessage()
SESSION="$1"

TASKS=(
"用 Read 工具完整读取 packages/core/src/core/geminiChat.ts"
"用 Read 工具完整读取 packages/core/src/core/llm-chat.ts"
"用 Read 工具完整读取 packages/core/src/tools/agent/agent.ts"
"用 grep -rn structuredClone packages/core/src 然后 Read 前 3 个文件"
"用 Read 完整读取 packages/cli/src/ui/hooks/slashCommandProcessor.ts"
Expand Down Expand Up @@ -399,7 +399,7 @@ done

```bash
# 1. 禁用 heap-pressure safety net
# geminiChat.ts: HEAP_PRESSURE_COMPRESSION_RATIO = 99.0
# llm-chat.ts: HEAP_PRESSURE_COMPRESSION_RATIO = 99.0

# 2. Build
npm run build --workspace=packages/core && npm run build --workspace=packages/cli
Expand Down
2 changes: 1 addition & 1 deletion docs/e2e-tests/worktree-phase-d.md
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ not an implementation issue. **Ready for Phase 7 code review.**
| ----------------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Re-attach to existing worktree (G1.b) | `packages/cli/src/startup/worktreeStartup.ts` | Added pre-create check: if dir is a registered worktree on the expected branch, skip create + chdir |
| `getRegisteredWorktreeBranch()` helper | `packages/core/src/services/gitWorktreeService.ts` | Probes `git rev-parse --abbrev-ref HEAD` against the candidate path |
| Path normalization before chdir (G2) | `packages/cli/src/gemini.tsx` | Resolves `mcpConfig`, `openaiLoggingDir`, `jsonFile`, `inputFile`, `telemetryOutfile`, `includeDirectories` against launch cwd when `--worktree` is set |
| Path normalization before chdir (G2) | `packages/cli/src/llm.tsx` | Resolves `mcpConfig`, `openaiLoggingDir`, `jsonFile`, `inputFile`, `telemetryOutfile`, `includeDirectories` against launch cwd when `--worktree` is set |
| Documentation: yargs flag ordering tip + Limitations update | `docs/users/features/worktree.md` | Quick Start tip + new Limitations bullets (cross-slug, path-arg behavior) |
| Unit tests for re-attach | `packages/cli/src/startup/worktreeStartup.test.ts` | Added 2 tests: happy re-attach + "different branch occupies slot" guard |

Expand Down
2 changes: 1 addition & 1 deletion docs/users/features/tool-use-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Three points that tend to trip up a first read of this feature:

1. **One generation per batch, shared by both display modes.** The fast-model call happens exactly once in `handleCompletedTools` when a tool batch finalizes. Toggling `Ctrl+O` expanded detail mode afterwards does **not** trigger a new call — both the collapsed and the expanded rendering read from the same `tool_use_summary` history entry that was captured the first time.
2. **No backfill on toggle or on session resume.** A `tool_group` that completed before the feature was enabled (or before you flipped the setting on, or in a resumed session — `ChatRecordingService` does not persist summary entries) will never get a label. There is no "sweep existing history" pass. If you turn this setting on mid-session, only _future_ batches will show a label; older groups keep the default rendering with no indicator that a label is missing.
3. **Main-agent batches only.** The trigger lives in the main session's turn loop (`useGeminiStream`), so:
3. **Main-agent batches only.** The trigger lives in the main session's turn loop (`useLlmStream`), so:
- ✅ Shell, MCP, file operations, and the `Task` / subagent tool _call itself_ (as it appears in the main batch) are summarized.
- ❌ A subagent's **internal** tool batches (run through `packages/core/src/agents/runtime/`) are not summarized.

Expand Down
1 change: 0 additions & 1 deletion eslint.legacy-filenames.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ export const legacyFilenames = [
'useFeedbackDialog',
'useFocus',
'useFolderTrust',
'useGeminiStream',
'useGitBranchName',
'useHistoryManager',
'useHooksDialog',
Expand Down
2 changes: 1 addition & 1 deletion packages/acp-bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11455,7 +11455,7 @@ export function createAcpSessionBridge(opts: BridgeOptions): AcpSessionBridge {
async generateSessionRecap(sessionId, _context) {
// Thin pass-through to `qwen/control/session/
// recap` — the ACP child runs `generateSessionRecap` against the
// session's GeminiClient history and returns `{sessionId, recap}`
// session's LlmClient history and returns `{sessionId, recap}`
// where `recap` may be `null` for too-short histories or transient
// model failures. The core helper is documented to never throw,
// so the only paths that surface as bridge errors are: unknown
Expand Down
Loading
Loading