GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — v0.0.15-beta.1 (3/3): Idle compaction follows OpenAI's cache; release by Obed0101 · Pull Request #145 · MendCode/MendCode Conversation
|
|
MendCode: @Obed0101's MendCode worked on this pull request on one of its devices; released 2026-11-11 07:52 UTC. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
1 finding · 🔴 1 critical
head fd777e2c157f
Merge risk: 🟡 Medium · The change affects when automatic compaction runs and therefore whether it can still read a cached conversation; overestimating retention can increase input costs, while underestimating it causes premature compaction. The learning algorithm is shared across providers, although the new model-specific defaults are limited to ChatGPT and official OpenAI API endpoints.
Change: Bug fix · Review effort: 2/5, about 15 minutes
This change makes idle-compaction defaults model-aware and allows cache-lifetime learning to tolerate short-gap misses when longer gaps reliably hit. No additional defects attributable to this stack layer were verified; the supplied performance report separately flags footprint increases of 7.9 MB after a turn and 3.3 MB at readiness. The four reader-summarized code files were inspected directly, all remaining changed hunks were read, and tests were reviewed but not executed under the read-only restriction.
Readers: 4 files went to readers instead of the review pass whole: 4 code files by gpt-6-luna (the review pass gets their summaries and the hunks of their risk spots; 1 call, up to 3 at once, 12,521 tokens counted). Their summaries are hints, not findings. 3 code files no reader could read went to the review pass whole (the reader gave no usable answer for this file).
Stacked on #144: only this pull request's own commits since #144's head 479cd5a.
| Finding | Where | |
|---|---|---|
| 🔴 | Measured rise above the noise: tui.after.fp_mb +7.9MB; total.after.fp_mb +7.9MB; tui.ready.fp_mb +3.3MB | packages/daemon/cards/cards.generated.json:2 |
Idle compaction now remembers the model from each session's latest main usage event and selects a 30-minute fallback for GPT-5.6 and later on official OpenAI API and ChatGPT providers. Cache-lifetime learning now uses the last sufficiently sampled group with reliable hits rather than stopping at the first failing group. The change also adds regression tests, updates the cache documentation, and records the beta and stable releases.
Changes
| Layer / files | Summary |
|---|---|
Cache-lifetime policy and exports packages/protocol/src/idle-compaction-data.ts, packages/protocol/src/wire.ts |
Add model-aware 30-minute defaults and public exports, and revise the observed-lifetime calculation to tolerate earlier failing groups. |
Idle-compaction scheduling and tests packages/daemon/src/idle-compaction.ts, packages/daemon/test/idle-compaction.test.ts |
Pass the latest usage event's model into lifetime selection and test scattered misses, model classification, provider defaults, and the resulting schedule. |
Documentation and release metadata CHANGELOG.md, docs/prompt-cache.md, packages/daemon/cards/cards.generated.json |
Document the revised lifetime policy, add v0.0.15-beta.1 and v0.0.15 release entries, and refresh the generated cards revision. |
| Check | Status | Explanation |
|---|---|---|
| Title | ✅ Passed | The title accurately identifies the idle-cache timing fix, release work, and position in the stack. |
| Description | The description explains the behavior and motivation but does not state how it was tested. Its weight claim also needs reconciliation with the separately supplied performance measurements. | |
| Out of scope | ✅ Passed | The changes fit the described cache fix and release work. The release notes summarize earlier stack work without introducing additional remote-control or image-rendering implementation changes here. |
Performance (perf-attrib, base 479cd5a against head fd777e2)
perf-attrib: sube: tui.after.fp_mb +7.9MB; total.after.fp_mb +7.9MB; tui.ready.fp_mb +3.3MB. Causes: tui.after.heap.type.Function +3; tui.rest.heap.type.Function +2; tui.rest.heap.type.StructureChain +2; tui.after.heap.type.JSLexicalEnvironment +1; tui.rest.ctor.native:Blob.bytes +725B; tui.rest.ctor.object:ModuleRecord.bytes +308B; tui.rest.ctor.code:NativeExecutable.bytes +80B
base 479cd5a694c1a170b8759fedbdc3edc2627969bd (479cd5a6) vs cand fd777e2c157f0d059102ad33101c96fce2b2bc27 (fd777e2c), median of 2 faux-engine session(s) per side; flagged = beyond the noise measured on 18 base-vs-base runs (x1.5).
| metric | base | cand | diff |
|---|---|---|---|
| tui.after.fp_mb | 57.4 | 65.3 | +7.9 UP |
| tui.after.peak_mb | 73.3 | 73.6 | +0.3 |
| tui.ready.fp_mb | 54.8 | 58.1 | +3.3 UP |
| tui.ready.peak_mb | 73.3 | 73.5 | +0.2 |
| tui.rest.fp_mb | 62.2 | 60.9 | -1.3 |
| tui.rest.peak_mb | 73.3 | 73.6 | +0.3 |
| tui.after.rss_mb | 133.9 | 108.1 | -25.8 down |
| tui.ready.rss_mb | 114 | 42.2 | -71.8 down |
| tui.rest.rss_mb | 93.1 | 105.9 | +12.8 UP |
| tui.after.heap.extra_b | 6697026 | 6802448 | +105422 |
| tui.after.heap.objects | 241308 | 241306 | -2 |
| tui.after.heap.protected | 19 | 20 | +1 UP |
| tui.after.heap.size_b | 24364946 | 24468960 | +104014 |
| tui.ready.heap.extra_b | 2872222 | 2895386 | +23164 |
| tui.ready.heap.objects | 217151 | 217214 | +63 |
| tui.ready.heap.protected | 18 | 18 | 0 |
| tui.ready.heap.size_b | 19298606 | 19330762 | +32156 |
| tui.rest.heap.extra_b | 3748634 | 4628262 | +879628 |
| tui.rest.heap.objects | 236030 | 238397 | +2367 |
| tui.rest.heap.protected | 18 | 18 | 0 |
| tui.rest.heap.size_b | 20955994 | 22075206 | +1119212 |
| tui.rest.js_code_b | 4901275 | 5841881 | +940606 |
| tui.rest.js_live_b | 19255805 | 19289558 | +33753 |
| tui.cpu_ms.after | 6226 | 6400 | +174 |
| tui.cpu_ms.ready | 365 | 371 | +6 |
| tui.cpu_ms.rest | 544 | 542 | -2 |
| binary.bytes | 72306944 | 72306944 | 0 |
| disk.bytes | 4112 | 4115 | +3 |
| disk.bytes_per_session | 2056 | 2058 | +2 |
JS object types that rose (count):
JS heap bytes by constructor that rose:
Modules loaded at start: 230 -> 230, 4632729 -> 4633037 bytes of chunks; chunk sizes only in cand: [1008970, 110586], only in base: [1008942, 110306] (chunk names are hashes: the list says which changed in size, not by what name)
Reference (skill, 2026-11-03, real model): footprint 64 ready / 66 after / peak 80 MB, 2.6 KB per session. This run (faux engine, whole process tree): 58.1 / 65.3 / peak 73.6 MB, 2058 B per session.
CHANGELOG.mddocs/prompt-cache.mdpackages/daemon/cards/cards.generated.jsonpackages/daemon/src/idle-compaction.tspackages/daemon/test/idle-compaction.test.tspackages/protocol/src/idle-compaction-data.tspackages/protocol/src/wire.tsComment @mendcode review to review again · @mendcode pause / resume · reply to a finding with explain, fix or learn · settings in .mendcode/review.yaml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…, leaving a session drops its open questions and keeps other chats subscribed, /sessions buttons name their session; bare sub-agents get no instruction files through mentions and no extension prompt or context rewrites
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
2 findings · 🟠 1 major · 🟡 1 minor
head 80f6e501efd1 · only the commits since the last review at fd777e2
Merge risk: 🟡 Medium · The change touches shared event subscriptions, replay ordering and interactive approval state, where regressions can silently prevent a phone from following or controlling a running turn. Engine changes are narrowly guarded by existing session limits.
Change: Bug fix · Review effort: 3/5, about 30 minutes
This increment improves Telegram session switching and running-turn replay, and isolates bare sub-agents from mention-loaded instructions and extension prompt rewrites. Review found two reliability defects in the session-switching lifecycle; the supplied performance measurements show no regression beyond noise. Six files arrived with reader summaries and were checked directly in relevant spans; no changed file was left unread, and tests were not run in this read-only review.
Readers: 6 files went to readers instead of the review pass whole: 6 code files by gpt-6-luna (the review pass gets their summaries and the hunks of their risk spots; 1 call, up to 3 at once, 16,445 tokens counted). Their summaries are hints, not findings. 2 code files no reader could read went to the review pass whole (the reader gave no usable answer for this file; the reader flagged more risk spots than a summary carries, so the file goes whole).
Incremental review: only what changed since the last review at fd777e2; the rest of the pull request was reviewed then (read other files with your tools when a change depends on them).
| Finding | Where | |
|---|---|---|
| 🟠 | Live events can advance a joining chat past the replay it needs 8/10 | packages/daemon/src/channels-bridge.ts:113-115 |
| 🟡 | A failed session switch loses the previous session's running-turn state 6/10 | packages/daemon/src/channels-bridge.ts:110-119 |
The Telegram bridge now identifies session buttons by session ID, preserves shared subscriptions while another chat still uses them, and clears stale questions when leaving a session. Watching a running session first reads its history and then replays events from the turn's start, with per-chat sequence tracking intended to suppress duplicates. Separately, the native engine applies existing bare-task limits to file mentions and to system-prompt and context extension handlers; idle-compaction and release changes are outside this incremental diff.
Changes
| Layer / files | Summary |
|---|---|
Telegram session lifecycle and replay packages/daemon/src/channels-bridge.ts, packages/daemon/src/channels.ts |
Adds running-turn replay, per-chat deduplication, shared-subscription release, stable session buttons and current-session request guards. |
Telegram regression coverage packages/daemon/test/channels-bridge.test.ts, packages/daemon/test/channels-daemon.test.ts |
Adds coverage for older session buttons, stale questions, shared subscriptions, replay deduplication and pairing during an approval. |
Bare sub-agent isolation packages/engine-native/src/engine.ts, packages/engine-native/test/run-limits.test.ts, packages/daemon/test/task-bare.test.ts |
Honors noHooks for prompt and context transformations and noContextFiles for mentions, with native-engine and child-task regression tests. |
Release notes CHANGELOG.md |
Documents the bare sub-agent instruction and extension isolation fixes. |
Sequence diagram
sequenceDiagram
participant Chat as Telegram chat
participant Bridge as Channel bridge
participant Client as Shared daemon client
participant Daemon
Chat->>Bridge: Pair or select session
Bridge->>Daemon: Read recap
Bridge->>Bridge: Assign target session and reset seen
Bridge->>Client: watch(sessionId)
Client->>Daemon: session.history(limit=1)
Daemon-->>Client: Latest turn
Client->>Daemon: Subscribe before running turn, or after latest window
Daemon-->>Client: Replay and live events
Client-->>Bridge: onEvent
Bridge-->>Chat: Prompt, progress and approval messages
| Check | Status | Explanation |
|---|---|---|
| Title | The title describes idle compaction and release work, but this increment changes Telegram behavior and bare sub-agent isolation instead. | |
| Description | The description explains the earlier compaction fix but does not explain these incremental fixes or how they were tested. | |
| Out of scope | Telegram lifecycle fixes and bare-task isolation are not explained by the title or description. The added changelog entry documents only the bare-task portion. |
Performance (perf-attrib, base 479cd5a against head 80f6e50)
perf-attrib: igual: nothing above the measured noise
base 479cd5a694c1a170b8759fedbdc3edc2627969bd (479cd5a6) vs cand 80f6e501efd1be3ffce29580286258750fd71cba (80f6e501), median of 2 faux-engine session(s) per side; flagged = beyond the noise measured on 18 base-vs-base runs (x1.5).
| metric | base | cand | diff |
|---|---|---|---|
| tui.after.fp_mb | 56.4 | 56.9 | +0.5 |
| tui.after.peak_mb | 72.7 | 73.3 | +0.6 |
| tui.ready.fp_mb | 54.6 | 54.7 | +0.1 |
| tui.ready.peak_mb | 72.7 | 73.3 | +0.6 |
| tui.rest.fp_mb | 56.3 | 56.6 | +0.3 |
| tui.rest.peak_mb | 72.7 | 73.3 | +0.6 |
| tui.after.rss_mb | 135.8 | 136 | +0.2 |
| tui.ready.rss_mb | 114 | 114 | 0 |
| tui.rest.rss_mb | 136.5 | 136.4 | -0.1 |
| tui.after.heap.extra_b | 7423830 | 6768693 | -655137 |
| tui.after.heap.objects | 243030 | 241324 | -1706 |
| tui.after.heap.protected | 20 | 20 | 0 |
| tui.after.heap.size_b | 25264934 | 24437125 | -827809 |
| tui.ready.heap.extra_b | 2871710 | 2872163 | +453 |
| tui.ready.heap.objects | 217156 | 217148 | -8 |
| tui.ready.heap.protected | 18 | 18 | 0 |
| tui.ready.heap.size_b | 19298622 | 19298851 | +229 |
| tui.rest.heap.extra_b | 4632673 | 4627743 | -4930 |
| tui.rest.heap.objects | 238456 | 238442 | -14 |
| tui.rest.heap.protected | 18 | 18 | 0 |
| tui.rest.heap.size_b | 22086593 | 22080399 | -6194 |
| tui.rest.js_code_b | 5849725 | 5843865 | -5860 |
| tui.rest.js_live_b | 19291133 | 19291427 | +294 |
| tui.cpu_ms.after | 5821 | 5735 | -86 |
| tui.cpu_ms.ready | 364 | 346 | -18 |
| tui.cpu_ms.rest | 517 | 498 | -19 |
| binary.bytes | 72306944 | 72306944 | 0 |
| disk.bytes | 4086 | 4080 | -6 |
| disk.bytes_per_session | 2043 | 2040 | -3 |
JS object types that rose (count):
JS heap bytes by constructor that rose:
Modules loaded at start: 230 -> 230, 4632729 -> 4633288 bytes of chunks; chunk sizes only in cand: [1009142, 251528, 110586], only in base: [1008942, 251449, 110306] (chunk names are hashes: the list says which changed in size, not by what name)
Reference (skill, 2026-11-03, real model): footprint 64 ready / 66 after / peak 80 MB, 2.6 KB per session. This run (faux engine, whole process tree): 54.7 / 56.9 / peak 73.3 MB, 2040 B per session.
CHANGELOG.mdpackages/daemon/src/channels-bridge.tspackages/daemon/src/channels.tspackages/daemon/test/channels-bridge.test.tspackages/daemon/test/channels-daemon.test.tspackages/daemon/test/task-bare.test.tspackages/engine-native/src/engine.tspackages/engine-native/test/run-limits.test.tsComment @mendcode review to review again · @mendcode pause / resume · reply to a finding with explain, fix or learn · settings in .mendcode/review.yaml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…atch answers and reads them in order, and a switch whose watch fails leaves the chat on its session with its running turn and open requests
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
1 finding · 🟠 1 major
head 7c7dfbaada2d · only the commits since the last review at 80f6e50
Merge risk: 🟡 Medium · The change affects asynchronous session ownership and delivery of potentially sensitive prompts, answers, and approval requests. Regressions can lose session events, invalidate pending interactions, or deliver buffered output after access is revoked.
Change: Bug fix · Review effort: 2/5, about 15 minutes
This incremental change makes Telegram session switching transactional: events are buffered during a watch, then replayed in sequence order, while failed watches preserve the previous session. The test file was initially reader-summarized; I directly inspected its changed helper and regression tests, the bridge implementation, and production callers. One security regression was found in completing a watch after a chat is unpaired; tests were not run because this review permits reading only.
Readers: 1 file went to readers instead of the review pass whole: 1 code file by gpt-6-luna (the review pass gets their summaries and the hunks of their risk spots; 1 call, up to 3 at once, 9,646 tokens counted). Their summaries are hints, not findings. 1 code file no reader could read went to the review pass whole (the reader flagged more risk spots than a summary carries, so the file goes whole).
Incremental review: only what changed since the last review at 80f6e50; the rest of the pull request was reviewed then (read other files with your tools when a change depends on them).
| Finding | Where | |
|---|---|---|
| 🟠 | Buffered session events can be sent to a chat after it is unpaired 8/10 | packages/daemon/src/channels-bridge.ts:102 |
The supplied incremental diff changes Telegram session attachment, not idle compaction or release metadata. A new join phase buffers target-session events while the watch starts; a successful attachment resets session-local state and delivers buffered events in sequence order. Failed switches retain the previous session's mirrored turn and pending questions. The same attachment path is used for session creation, restoration, and explicit switching.
Changes
| Layer / files | Summary |
|---|---|
Telegram session attachment packages/daemon/src/channels-bridge.ts |
Adds buffered join and commit phases, extracts event delivery, and routes session restoration and switching through them. |
Regression coverage packages/daemon/test/channels-bridge.test.ts |
Adds an asynchronous watch hook and tests for out-of-order replay during attachment and preservation of the previous session after a failed watch. |
Sequence diagram
sequenceDiagram
participant Chat as Telegram chat
participant Bridge as Channel bridge
participant Host as Daemon host
Chat->>Bridge: Select session
Bridge->>Host: watch(target)
Host-->>Bridge: Replay and live events
Note over Bridge: Buffer target events; retain previous session
Host-->>Bridge: Watch result
alt Watch succeeds
Bridge->>Bridge: Enter target and deliver buffered events by seq
Bridge-->>Chat: Mirrored output and requests
else Watch fails
Bridge-->>Chat: Report failure; preserve previous session
end
| Check | Status | Explanation |
|---|---|---|
| Title | The title describes OpenAI idle compaction and a release, whereas the supplied incremental diff changes Telegram session attachment. Earlier reviewed commits may explain the overall title, but it does not identify this follow-up. | |
| Description | The description explains the cache-related fix but does not describe the Telegram attachment changes or their regression coverage. | |
| Out of scope | Both changed files concern Telegram replay and session-switch failure handling, which the supplied title and description do not explain. |
Performance (perf-attrib, base 479cd5a against head 7c7dfba)
perf-attrib: igual: nothing above the measured noise
base 479cd5a694c1a170b8759fedbdc3edc2627969bd (479cd5a6, cached build) vs cand 7c7dfbaada2d109b7c06fbcdfbeb7f80c68225ef (7c7dfbaa), median of 2 faux-engine session(s) per side; flagged = beyond the noise measured on 18 base-vs-base runs (x1.5).
| metric | base | cand | diff |
|---|---|---|---|
| tui.after.fp_mb | 56.8 | 57.7 | +0.9 |
| tui.after.peak_mb | 73.4 | 73.7 | +0.3 |
| tui.ready.fp_mb | 54.6 | 55.1 | +0.5 |
| tui.ready.peak_mb | 73.4 | 73.7 | +0.3 |
| tui.rest.fp_mb | 56.8 | 57.1 | +0.3 |
| tui.rest.peak_mb | 73.4 | 73.7 | +0.3 |
| tui.after.rss_mb | 111.7 | 136.2 | +24.5 UP |
| tui.ready.rss_mb | 113.9 | 114.4 | +0.5 |
| tui.rest.rss_mb | 112.3 | 136.5 | +24.2 UP |
| tui.after.heap.extra_b | 6826766 | 6735916 | -90850 |
| tui.after.heap.objects | 241346 | 241346 | 0 |
| tui.after.heap.protected | 20 | 20 | 0 |
| tui.after.heap.size_b | 24494734 | 24407068 | -87666 |
| tui.ready.heap.extra_b | 2872148 | 2895374 | +23226 |
| tui.ready.heap.objects | 217147 | 217221 | +74 |
| tui.ready.heap.protected | 18 | 18 | 0 |
| tui.ready.heap.size_b | 19298756 | 19330942 | +32186 |
| tui.rest.heap.extra_b | 4670388 | 4669517 | -871 |
| tui.rest.heap.objects | 238440 | 238466 | +26 |
| tui.rest.heap.protected | 18 | 18 | 0 |
| tui.rest.heap.size_b | 22121209 | 22122317 | +1108 |
| tui.rest.js_code_b | 5886057 | 5885625 | -432 |
| tui.rest.js_live_b | 19290886 | 19292515 | +1629 |
| tui.cpu_ms.after | 5799 | 5732 | -67 |
| tui.cpu_ms.ready | 362 | 346 | -16 |
| tui.cpu_ms.rest | 503 | 497 | -6 |
| binary.bytes | 72306944 | 72306944 | 0 |
| disk.bytes | 4078 | 4081 | +3 |
| disk.bytes_per_session | 2039 | 2041 | +2 |
JS object types that rose (count):
JS heap bytes by constructor that rose:
Modules loaded at start: 230 -> 230, 4632729 -> 4633288 bytes of chunks; chunk sizes only in cand: [1009142, 251528, 110586], only in base: [1008942, 251449, 110306] (chunk names are hashes: the list says which changed in size, not by what name)
Reference (skill, 2026-11-03, real model): footprint 64 ready / 66 after / peak 80 MB, 2.6 KB per session. This run (faux engine, whole process tree): 55.1 / 57.7 / peak 73.7 MB, 2041 B per session.
packages/daemon/src/channels-bridge.tspackages/daemon/test/channels-bridge.test.tsComment @mendcode review to review again · @mendcode pause / resume · reply to a finding with explain, fix or learn · settings in .mendcode/review.yaml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…he events held for it, and the watch is released
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No findings · nothing in this change was confirmed as a problem
head 1aed947efa71 · only the commits since the last review at 7c7dfba
Merge risk: 🟡 Medium · The change touches asynchronous subscription cleanup and the authorization boundary for forwarding session content to Telegram. A regression could expose buffered session details after unpairing or interrupt a shared subscription, although the patch is localized and adds a targeted regression test.
Change: Bug fix · Review effort: 1/5, about 5 minutes
The incremental change prevents a Telegram chat unpaired during session-watch startup from receiving buffered session events, releases the abandoned watch, and adds a regression test. No introduced defects were found after inspecting the callers, pairing lifecycle, shared-watch cleanup, and serialized update handling; tests were reviewed but could not be run with the read-only tools.
Readers: 2 code files no reader could read went to the review pass whole (the diff is small: one reader call costs more than the readers' share of this review's cap, so the review pass reads it).
Incremental review: only what changed since the last review at 7c7dfba; the rest of the pull request was reviewed then (read other files with your tools when a change depends on them).
The bridge now passes the chat ID into its session-joining helper and checks, after the asynchronous watch completes, that the runtime still belongs to a paired chat. If pairing was revoked, it discards buffered events, releases a successful watch, and returns a distinct cancellation result so callers avoid creating a replacement session or sending a misleading watch-failure message. The incremental diff changes only the Telegram bridge and its test coverage; it does not change idle compaction or release metadata.
Changes
| Layer / files | Summary |
|---|---|
Telegram session-watch lifecycle packages/daemon/src/channels-bridge.ts |
Validate pairing and runtime identity after watch startup, release abandoned subscriptions, and propagate cancellation through session creation, switching, and restoration. |
Regression coverage packages/daemon/test/channels-bridge.test.ts |
Simulate terminal-side unpairing during watch startup and assert that buffered approval details are not sent and the abandoned watch is released. |
Sequence diagram
sequenceDiagram
participant Chat as Telegram chat
participant Bridge as Channel bridge
participant Host as Session host
participant Control as Terminal control
Chat->>Bridge: Select session
Bridge->>Host: watch(sessionId)
Host-->>Bridge: Session events buffered during startup
Control->>Bridge: Remove pairing and forget runtime
Host-->>Bridge: Watch succeeds
Bridge->>Bridge: Detect revoked pairing or stale runtime
Bridge->>Host: unwatch(sessionId) unless another chat follows it
Bridge-->>Chat: Answer callback: Not switched
| Check | Status | Explanation |
|---|---|---|
| Title | The title describes idle compaction and a release, whereas this incremental diff fixes Telegram unpairing during watch startup. It may describe previously reviewed commits, but it does not identify this additional fix. | |
| Description | The description explains the cache-related compaction change but does not explain this Telegram lifecycle fix or how it was tested. The diff includes a targeted regression test, but no execution results are supplied for it. | |
| Out of scope | Both changed files address Telegram subscription handling, which the title and description do not explain. Updating the PR description would make this incremental security-related fix explicit. |
Performance (perf-attrib, base 479cd5a against head 1aed947)
perf-attrib: nota: no total rose; inside, tui.ready.heap.objects +120
base 479cd5a694c1a170b8759fedbdc3edc2627969bd (479cd5a6, cached build) vs cand 1aed947efa71e3694ca6a5175cd0cb796b421fc6 (1aed947e), median of 2 faux-engine session(s) per side; flagged = beyond the noise measured on 18 base-vs-base runs (x1.5).
| metric | base | cand | diff |
|---|---|---|---|
| tui.after.fp_mb | 57.2 | 57.3 | +0.1 |
| tui.after.peak_mb | 73.6 | 74.1 | +0.5 |
| tui.ready.fp_mb | 54.5 | 54.6 | +0.1 |
| tui.ready.peak_mb | 73.6 | 72.8 | -0.8 |
| tui.rest.fp_mb | 56.6 | 57.4 | +0.8 |
| tui.rest.peak_mb | 73.6 | 74.1 | +0.5 |
| tui.after.rss_mb | 110 | 99 | -11 down |
| tui.ready.rss_mb | 114.2 | 114 | -0.2 |
| tui.rest.rss_mb | 110.7 | 102 | -8.7 down |
| tui.after.heap.extra_b | 6572579 | 7407713 | +835134 |
| tui.after.heap.objects | 241151 | 243008 | +1857 |
| tui.after.heap.protected | 20 | 20 | 0 |
| tui.after.heap.size_b | 24246227 | 25247233 | +1001006 |
| tui.ready.heap.extra_b | 2856762 | 2895382 | +38620 |
| tui.ready.heap.objects | 217090 | 217210 | +120 UP |
| tui.ready.heap.protected | 18 | 18 | 0 |
| tui.ready.heap.size_b | 19276138 | 19330403 | +54265 |
| tui.rest.heap.extra_b | 3759818 | 3732321 | -27497 |
| tui.rest.heap.objects | 235911 | 236014 | +103 |
| tui.rest.heap.protected | 18 | 18 | 0 |
| tui.rest.heap.size_b | 20957642 | 20937009 | -20633 |
| tui.rest.js_code_b | 4916697 | 4885412 | -31285 |
| tui.rest.js_live_b | 19256861 | 19255890 | -971 |
| tui.cpu_ms.after | 5503 | 5646 | +143 |
| tui.cpu_ms.ready | 361 | 345 | -16 |
| tui.cpu_ms.rest | 505 | 493 | -12 |
| binary.bytes | 72306944 | 72306944 | 0 |
| disk.bytes | 4075 | 4077 | +2 |
| disk.bytes_per_session | 2038 | 2039 | +1 |
JS object types that rose (count):
JS heap bytes by constructor that rose:
Modules loaded at start: 230 -> 230, 4632729 -> 4633288 bytes of chunks; chunk sizes only in cand: [1009142, 251528, 110586], only in base: [1008942, 251449, 110306] (chunk names are hashes: the list says which changed in size, not by what name)
Reference (skill, 2026-11-03, real model): footprint 64 ready / 66 after / peak 80 MB, 2.6 KB per session. This run (faux engine, whole process tree): 54.6 / 57.3 / peak 74.1 MB, 2039 B per session.
packages/daemon/src/channels-bridge.tspackages/daemon/test/channels-bridge.test.tsComment @mendcode review to review again · @mendcode pause / resume · reply to a finding with explain, fix or learn · settings in .mendcode/review.yaml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
MendCode: 1 check failed on 1aed947, which MendCode reviewed. checks (daemon, daemon, false) (details) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…the tree is main's)
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No findings · nothing in this change was confirmed as a problem
head 758e1ededc07 · only the commits since the last review at 1aed947
Head 758e1ed has the same files as the reviewed head 1aed947: nothing changed, so no model was called.
Comment @mendcode review to review again · @mendcode pause / resume · reply to a finding with explain, fix or learn · settings in .mendcode/review.yaml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.