Repository navigation
feat(loop): inject a .qwen/loop.md task file at fire time via sentinels #5890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 27 commits
f1879c0
7b630fe
f36a5c8
9b70f16
91759a8
a6da917
6c7466d
0e2128f
a278fd0
89f5ff8
1ad5362
3e19ba5
60edea8
c0a962a
d0561f0
565398e
e77e66e
d9db495
f402bae
300060c
5acd11a
eb0f082
44f45c0
21aebdd
2f43aeb
75c6c37
9271c43
54082f0
2116715
73df2ef
0198307
4ab4012
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |||||||||||||||||||||||||||||||||||||
| * SPDX-License-Identifier: Apache-2.0 | ||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import * as os from 'node:os'; | ||||||||||||||||||||||||||||||||||||||
| import * as path from 'node:path'; | ||||||||||||||||||||||||||||||||||||||
| import type { | ||||||||||||||||||||||||||||||||||||||
| Content, | ||||||||||||||||||||||||||||||||||||||
| FunctionCall, | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -28,11 +30,14 @@ import type { | |||||||||||||||||||||||||||||||||||||
| GoalTerminalEvent, | ||||||||||||||||||||||||||||||||||||||
| ToolCallRequestInfo, | ||||||||||||||||||||||||||||||||||||||
| ToolCallResponseInfo, | ||||||||||||||||||||||||||||||||||||||
| LoopTickResult, | ||||||||||||||||||||||||||||||||||||||
| } from '@qwen-code/qwen-code-core'; | ||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||
| AuthType, | ||||||||||||||||||||||||||||||||||||||
| ApprovalMode, | ||||||||||||||||||||||||||||||||||||||
| CompressionStatus, | ||||||||||||||||||||||||||||||||||||||
| detectLoopSentinel, | ||||||||||||||||||||||||||||||||||||||
| LoopTickResolver, | ||||||||||||||||||||||||||||||||||||||
| convertToFunctionResponse, | ||||||||||||||||||||||||||||||||||||||
| createDuplicateProviderToolCallResponse, | ||||||||||||||||||||||||||||||||||||||
| findRepeatedDuplicateProviderToolCall, | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -667,6 +672,13 @@ export class Session implements SessionContext { | |||||||||||||||||||||||||||||||||||||
| private cronQueue: CronQueueItem[] = []; | ||||||||||||||||||||||||||||||||||||||
| private cronProcessing = false; | ||||||||||||||||||||||||||||||||||||||
| private cronAbortController: AbortController | null = null; | ||||||||||||||||||||||||||||||||||||||
| // Resolves the `<<loop.md>>` / `<<loop.md-dynamic>>` sentinels at fire time. | ||||||||||||||||||||||||||||||||||||||
| // Lazily created on the first loop tick; its content cache is reset on | ||||||||||||||||||||||||||||||||||||||
| // compaction (see #sendMessageStreamWithAutoCompression) and it is rebuilt if | ||||||||||||||||||||||||||||||||||||||
| // the working dir changes (e.g. /cd) so it always reads the current project's | ||||||||||||||||||||||||||||||||||||||
| // loop.md. | ||||||||||||||||||||||||||||||||||||||
| private loopTickResolver: LoopTickResolver | null = null; | ||||||||||||||||||||||||||||||||||||||
| private loopTickResolverRoot: string | null = null; | ||||||||||||||||||||||||||||||||||||||
| private cronCompletion: Promise<void> | null = null; | ||||||||||||||||||||||||||||||||||||||
| private cronDisabledByTokenLimit = false; | ||||||||||||||||||||||||||||||||||||||
| private lastPromptTokenCount = 0; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -1927,6 +1939,10 @@ export class Session implements SessionContext { | |||||||||||||||||||||||||||||||||||||
| compressionInfo = compressed; | ||||||||||||||||||||||||||||||||||||||
| this.#recordCompressionTokenCount(compressed); | ||||||||||||||||||||||||||||||||||||||
| if (compressed.compressionStatus === CompressionStatus.COMPRESSED) { | ||||||||||||||||||||||||||||||||||||||
| // Context was just compacted; a loop.md tick must re-deliver the full | ||||||||||||||||||||||||||||||||||||||
| // task block (a short reminder refers back to a message that is no | ||||||||||||||||||||||||||||||||||||||
| // longer in context). | ||||||||||||||||||||||||||||||||||||||
| this.loopTickResolver?.resetCache(); | ||||||||||||||||||||||||||||||||||||||
| const reasonClause = | ||||||||||||||||||||||||||||||||||||||
| compressed.triggerReason === 'image_overflow' | ||||||||||||||||||||||||||||||||||||||
| ? `accumulated enough tool screenshots to trigger compaction for ${this.config.getModel()}` | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -2445,6 +2461,44 @@ export class Session implements SessionContext { | |||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| #getLoopTickResolver(): LoopTickResolver { | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] No Session-level test exercises the working-dir-change rebuild path here. All existing Session loop tests use a single fixed A regression that drops the Test needed: Fire two loop ticks with — qwen3.7-max via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| const root = this.config.getWorkingDir(); | ||||||||||||||||||||||||||||||||||||||
| // Rebuild if the working dir changed (e.g. /cd) so loop.md resolves against | ||||||||||||||||||||||||||||||||||||||
| // the current project; a fresh resolver also correctly re-delivers full. | ||||||||||||||||||||||||||||||||||||||
| if (!this.loopTickResolver || this.loopTickResolverRoot !== root) { | ||||||||||||||||||||||||||||||||||||||
| // Resolve the home/global loop.md from the QWEN_HOME-aware global dir (the | ||||||||||||||||||||||||||||||||||||||
| // rest of Qwen honors QWEN_HOME for `.qwen`); reading raw os.homedir() here | ||||||||||||||||||||||||||||||||||||||
| // would always hit the real `~/.qwen` and ignore a relocated config home. | ||||||||||||||||||||||||||||||||||||||
| const homeQwenDir = Storage.getGlobalQwenDir(); | ||||||||||||||||||||||||||||||||||||||
| // Confinement root for the home candidate's resolved target: $QWEN_HOME | ||||||||||||||||||||||||||||||||||||||
| // when set (it IS the global dir), else $HOME — keeps the earlier | ||||||||||||||||||||||||||||||||||||||
| // confinement (an in-root dotfile symlink resolves; an escape is refused). | ||||||||||||||||||||||||||||||||||||||
| // The `|| path.dirname(homeQwenDir)` guards an empty os.homedir() (minimal | ||||||||||||||||||||||||||||||||||||||
| // containers with no HOME): an empty root makes isWithin('', target) always | ||||||||||||||||||||||||||||||||||||||
| // true, trivially bypassing the symlink confinement. homeQwenDir | ||||||||||||||||||||||||||||||||||||||
| // (Storage.getGlobalQwenDir()) is always non-empty, so its parent is a | ||||||||||||||||||||||||||||||||||||||
| // sound non-empty fallback root. | ||||||||||||||||||||||||||||||||||||||
| const homeConfineRoot = | ||||||||||||||||||||||||||||||||||||||
| (process.env['QWEN_HOME'] ? homeQwenDir : os.homedir()) || | ||||||||||||||||||||||||||||||||||||||
| path.dirname(homeQwenDir); | ||||||||||||||||||||||||||||||||||||||
| this.loopTickResolver = new LoopTickResolver({ | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Critical] — GPT-5 via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| projectRoot: root, | ||||||||||||||||||||||||||||||||||||||
| homeDir: homeConfineRoot, | ||||||||||||||||||||||||||||||||||||||
| homeQwenDir, | ||||||||||||||||||||||||||||||||||||||
| // The project `.qwen/loop.md` is repo-controlled, so an untrusted folder | ||||||||||||||||||||||||||||||||||||||
| // must not read it and feed it to the model (mirrors getProjectHooks()'s | ||||||||||||||||||||||||||||||||||||||
| // trust gate). The home/global `~/.qwen/loop.md` is user-owned and stays | ||||||||||||||||||||||||||||||||||||||
| // allowed. Pass a getter, not a snapshot: isTrustedFolder() can flip | ||||||||||||||||||||||||||||||||||||||
| // mid-session on an IDE workspace-trust update, and the resolver outlives | ||||||||||||||||||||||||||||||||||||||
| // a single tick — re-read it on every resolve() so a trusted→untrusted | ||||||||||||||||||||||||||||||||||||||
| // flip stops reading the project file immediately. | ||||||||||||||||||||||||||||||||||||||
| allowProjectFile: () => this.config.isTrustedFolder(), | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
| this.loopTickResolverRoot = root; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| return this.loopTickResolver; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||
| * Executes a single cron-fired prompt: echoes it as a user message with | ||||||||||||||||||||||||||||||||||||||
| * `_meta.source='cron'`, streams the model response, and handles tool calls. | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -2478,10 +2532,96 @@ export class Session implements SessionContext { | |||||||||||||||||||||||||||||||||||||
| async () => { | ||||||||||||||||||||||||||||||||||||||
| let turnCount = 0; | ||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||
| // A `<<loop.md>>` / `<<loop.md-dynamic>>` sentinel is expanded at | ||||||||||||||||||||||||||||||||||||||
| // fire time into the loop.md task block — full on the first or a | ||||||||||||||||||||||||||||||||||||||
| // changed fire, a short reminder when unchanged. Non-sentinel | ||||||||||||||||||||||||||||||||||||||
| // prompts pass through untouched. | ||||||||||||||||||||||||||||||||||||||
| const loopMode = detectLoopSentinel(prompt); | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Critical] This expansion happens after the scheduled prompt has already been approved/classified as the harmless literal sentinel. Because — GPT-5 via Qwen Code /review
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion]
The re-arm instruction is about the firing mechanism (does this job auto-repeat?), which
Suggested change
— claude-opus-4-8 via Qwen Code /qreview |
||||||||||||||||||||||||||||||||||||||
| let loopTick: LoopTickResult | null = null; | ||||||||||||||||||||||||||||||||||||||
| if (loopMode) { | ||||||||||||||||||||||||||||||||||||||
| const resolver = this.#getLoopTickResolver(); | ||||||||||||||||||||||||||||||||||||||
| // Capture folder-trust ONCE for this tick and thread it through | ||||||||||||||||||||||||||||||||||||||
| // both the resolve probe and the error path. isTrustedFolder() | ||||||||||||||||||||||||||||||||||||||
| // can flip mid-tick (an IDE workspace-trust update), so two | ||||||||||||||||||||||||||||||||||||||
| // separate reads could let the sanitized error name a different | ||||||||||||||||||||||||||||||||||||||
| // candidate set than resolve() actually probed. | ||||||||||||||||||||||||||||||||||||||
| const trustedAtResolve = this.config.isTrustedFolder(); | ||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||
| loopTick = await resolver.resolve(loopMode, trustedAtResolve); | ||||||||||||||||||||||||||||||||||||||
| } catch (resolveErr) { | ||||||||||||||||||||||||||||||||||||||
| // resolve() reads .qwen/loop.md (project or home/global); an | ||||||||||||||||||||||||||||||||||||||
| // EACCES/EIO here is a sentinel-RESOLUTION failure, not a | ||||||||||||||||||||||||||||||||||||||
| // model-call failure — tag it so the two are distinguishable | ||||||||||||||||||||||||||||||||||||||
| // in logs. | ||||||||||||||||||||||||||||||||||||||
| const code = | ||||||||||||||||||||||||||||||||||||||
| (resolveErr as NodeJS.ErrnoException).code ?? 'unknown'; | ||||||||||||||||||||||||||||||||||||||
| // Full detail — including the raw fs error's ABSOLUTE loop.md | ||||||||||||||||||||||||||||||||||||||
| // path (OS username + dir layout) — stays in this LOCAL debug | ||||||||||||||||||||||||||||||||||||||
| // log only; debug logs are never sent to the ACP client. | ||||||||||||||||||||||||||||||||||||||
| debugLogger.warn( | ||||||||||||||||||||||||||||||||||||||
| `loop.md sentinel resolution failed (mode=${loopMode}, code=${code}) — check .qwen/loop.md permissions/IO`, | ||||||||||||||||||||||||||||||||||||||
| resolveErr, | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| if (loopMode === 'dynamic') { | ||||||||||||||||||||||||||||||||||||||
| // A `dynamic` (self-paced) loop is kept alive ONLY by the | ||||||||||||||||||||||||||||||||||||||
| // model re-arming LoopWakeup at the end of each turn; the | ||||||||||||||||||||||||||||||||||||||
| // firing wakeup was already consumed, so throwing here (no | ||||||||||||||||||||||||||||||||||||||
| // turn → no re-arm) would silently kill the loop forever on a | ||||||||||||||||||||||||||||||||||||||
| // transient hiccup (EACCES/EIO, or a Windows editor/AV briefly | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The dynamic branch catches ALL errors from Consider filtering to known fs error codes and re-throwing unexpected errors:
Suggested change
— qwen3.7-max via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| // locking the file). Degrade to a no-op tick mirroring the | ||||||||||||||||||||||||||||||||||||||
| // absent path so the model still re-arms and the loop survives. | ||||||||||||||||||||||||||||||||||||||
| // (`cron` re-fires on its own next interval, so it still | ||||||||||||||||||||||||||||||||||||||
| // throws below.) The captured trust names the SAME candidate | ||||||||||||||||||||||||||||||||||||||
| // set the probe used; the errno (no absolute path) is noted. | ||||||||||||||||||||||||||||||||||||||
| loopTick = resolver.buildTransientErrorTick( | ||||||||||||||||||||||||||||||||||||||
| loopMode, | ||||||||||||||||||||||||||||||||||||||
| trustedAtResolve, | ||||||||||||||||||||||||||||||||||||||
| code, | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||
| // Re-throw a SANITIZED error: the outer cron catch forwards | ||||||||||||||||||||||||||||||||||||||
| // error.message verbatim to the client via emitAgentMessage, | ||||||||||||||||||||||||||||||||||||||
| // so re-throwing the raw fs error would leak that absolute | ||||||||||||||||||||||||||||||||||||||
| // path. Surface only the candidate labels + errno code via the | ||||||||||||||||||||||||||||||||||||||
| // shared absentLocations() — reusing the QWEN_HOME-aware home | ||||||||||||||||||||||||||||||||||||||
| // label (never a hardcoded `~/.qwen`) and naming the project | ||||||||||||||||||||||||||||||||||||||
| // candidate only when it was actually read (the captured trust | ||||||||||||||||||||||||||||||||||||||
| // matches the resolve() probe, so an untrusted folder can't | ||||||||||||||||||||||||||||||||||||||
| // falsely claim `(project)`). | ||||||||||||||||||||||||||||||||||||||
| throw new Error( | ||||||||||||||||||||||||||||||||||||||
| `loop.md resolution failed (${code}) for ${resolver.absentLocations( | ||||||||||||||||||||||||||||||||||||||
| trustedAtResolve, | ||||||||||||||||||||||||||||||||||||||
| )}`, | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| const modelText = loopTick ? loopTick.modelText : prompt; | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Critical] — GPT-5 via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| if (loopTick) { | ||||||||||||||||||||||||||||||||||||||
| debugLogger.debug( | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The tick delivery debug log cannot distinguish a transient-error tick from a genuinely-absent file. Both Add a
Suggested change
— qwen3.7-max via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| `loop tick: mode=${loopMode} delivery=${ | ||||||||||||||||||||||||||||||||||||||
| loopTick.full | ||||||||||||||||||||||||||||||||||||||
| ? 'full' | ||||||||||||||||||||||||||||||||||||||
| : loopTick.sourceLabel | ||||||||||||||||||||||||||||||||||||||
| ? 'reminder' | ||||||||||||||||||||||||||||||||||||||
| : 'absent' | ||||||||||||||||||||||||||||||||||||||
| } source=${loopTick.sourceLabel ?? 'none'}`, | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| // For a loop tick echo a stable, relative label — never the bare | ||||||||||||||||||||||||||||||||||||||
| // sentinel or the full task dump (and the resolver never hands back | ||||||||||||||||||||||||||||||||||||||
| // the absolute path, which would leak the OS username / dir layout | ||||||||||||||||||||||||||||||||||||||
| // into the ACP client UI); otherwise echo the prompt verbatim. | ||||||||||||||||||||||||||||||||||||||
| const echoText = loopTick | ||||||||||||||||||||||||||||||||||||||
| ? loopTick.sourceLabel | ||||||||||||||||||||||||||||||||||||||
| ? `Loop tick — tasks from ${loopTick.sourceLabel}` | ||||||||||||||||||||||||||||||||||||||
| : 'Loop tick — loop.md not present' | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The new absent-file branch ( — GPT-5 via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| : prompt; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // Echo the cron prompt as a user message so the client sees it | ||||||||||||||||||||||||||||||||||||||
| await this.sendUpdate({ | ||||||||||||||||||||||||||||||||||||||
| sessionUpdate: 'user_message_chunk', | ||||||||||||||||||||||||||||||||||||||
| content: { type: 'text', text: prompt }, | ||||||||||||||||||||||||||||||||||||||
| content: { type: 'text', text: echoText }, | ||||||||||||||||||||||||||||||||||||||
| _meta: { source: item.source }, | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
@@ -2490,7 +2630,7 @@ export class Session implements SessionContext { | |||||||||||||||||||||||||||||||||||||
| const cronReminders = await this.#buildInitialSystemReminders(); | ||||||||||||||||||||||||||||||||||||||
| let nextMessage: Content | null = { | ||||||||||||||||||||||||||||||||||||||
| role: 'user', | ||||||||||||||||||||||||||||||||||||||
| parts: [...cronReminders, { text: prompt }], | ||||||||||||||||||||||||||||||||||||||
| parts: [...cronReminders, { text: modelText }], | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| while (nextMessage !== null) { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -2519,6 +2659,13 @@ export class Session implements SessionContext { | |||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| const responseStream = sendResult.responseStream; | ||||||||||||||||||||||||||||||||||||||
| if (loopTick && turnCount === 1) { | ||||||||||||||||||||||||||||||||||||||
| // The block reached the model (the send started); commit it so | ||||||||||||||||||||||||||||||||||||||
| // the next tick can detect "unchanged". Deferring the commit | ||||||||||||||||||||||||||||||||||||||
| // to here keeps an abort before delivery from poisoning the | ||||||||||||||||||||||||||||||||||||||
| // cache into a dangling short reminder. | ||||||||||||||||||||||||||||||||||||||
| this.loopTickResolver?.markDelivered(); | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] Consider having — qwen3.7-max via Qwen Code /review |
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| nextMessage = null; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| for await (const resp of responseStream) { | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Critical] This cache reset only covers automatic sends. ACP
/compressand/compress-fastcallgeminiClient.tryCompressChat/tryCompressChatFastdirectly from the slash-command handlers and return through#processSlashCommandResult, so this Session'sloopTickResolvercache survives a successful manual compression. The next unchanged loop tick can then send only a short reminder even though the full block was summarized away. Centralize a compression-completed hook, or resetloopTickResolverafter successful ACP compression commands too.— GPT-5 via Qwen Code /review