Skip to content

fix(session): correct compaction ordering, plan-switch reminder, and logs tail - #163

Merged
DevFlex-AI merged 3 commits into
devfrom
bugfixes
Aug 4, 2026
Merged

fix(session): correct compaction ordering, plan-switch reminder, and logs tail#163
DevFlex-AI merged 3 commits into
devfrom
bugfixes

Conversation

@DevFlex-AI

@DevFlex-AI DevFlex-AI commented Aug 4, 2026

Copy link
Copy Markdown

Three correctness bugs found by auditing the session runtime, each confirmed by reading the code paths end to end.

1. Compaction deleted history before the summary existed (data loss). In session/compaction.ts, the block that removes summarized head/hidden messages ran before processor.process(...) generated the summary. So when summarization failed (rate limit, network error, or the "Session too large to compact" branch that returns "stop"), the original messages were already hard-deleted by the projector and unrecoverable. Moved the removal to after the summary is produced and the result === "compact" early-return has been passed.

Added a regression test (keeps summarized history when compaction fails) that seeds head turns, forces a "compact" failure, and asserts the history survives. Verified it fails on the pre-fix ordering and passes after.

Follow-up from review: a "stop" result with an errored assistant message also means no valid summary exists, so the removal block is additionally gated on !processor.message.error, with a matching regression test (keeps summarized history when processing stops with an error).

2. Plan->build switch reminder never fired. The default agent was renamed (build: { name: "code", ... } in agent/agent.ts), but session/reminders.ts still gated on input.agent.name === "build", which is now unreachable. So after working in the plan agent and switching back to implement, the BUILD_SWITCH reminder was never appended and the model often kept refusing edits. Changed the comparison to "code".

3. bolt logs --tail 0 dumped the entire log. lines.slice(-count) with count === 0 is slice(0), which returns everything. Guarded the zero case to print nothing.

Verified: bun run typecheck clean; full compaction suite 53 pass / 1 skip.

Note: the audit also flagged a server-side model-resolution change (runner/model.ts uses catalog.model.cheapest() where upstream used default(), so a configured default model is ignored for model-less v2 sessions). That one may be intentional fork behavior, so I left it out pending a product call.


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

Summary by CodeRabbit

  • New Features

    • Added support for logs --tail 0 to hide existing log entries while continuing to stream new entries with --follow.
  • Bug Fixes

    • Prevented failed or interrupted compaction from removing conversation history.
    • Preserved summarized history until compaction completes successfully.
    • Fixed the build-switch reminder when transitioning from plan mode to code mode.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
bolt-cli-app Skipped Skipped Aug 4, 2026 7:01pm

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR moves compaction cleanup after successful summary persistence, adds regression coverage for failed compaction, fixes logs --tail 0, and updates the build-switch reminder transition condition.

Changes

Compaction cleanup

Layer / File(s) Summary
Post-persistence compaction cleanup
packages/opencode/src/session/compaction.ts
Non-overflow compactions clean summarized and hidden messages after successful summary persistence while preserving the parent message.
Failed compaction regression coverage
packages/opencode/test/session/compaction.test.ts
The test processor supports stopped results. Tests verify that failed or stopped compaction preserves earlier summarized messages.

Log tail behavior

Layer / File(s) Summary
Zero-tail output handling
packages/opencode/src/cli/cmd/logs.ts
logs --tail 0 skips existing log lines while follow mode can stream new lines.

Agent transition reminder

Layer / File(s) Summary
Build-switch transition condition
packages/opencode/src/session/reminders.ts
The reminder now triggers when the target agent is code.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: thdxr, kitlangton, jlongster

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the three primary fixes: compaction ordering, the plan-switch reminder, and log tail handling.
Description check ✅ Passed The description clearly explains the three fixes, their causes, regression tests, and verification results, but omits several template sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfixes

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Aug 4, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 3944bef...7d0d172 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade  

Focus Area: Reliability
Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 4, 2026 7:01p.m. Review ↗
Shell Aug 4, 2026 7:01p.m. Review ↗
Secrets Aug 4, 2026 7:01p.m. Review ↗
Docker Aug 4, 2026 7:01p.m. Review ↗
Python Aug 4, 2026 7:01p.m. Review ↗
CSS Aug 4, 2026 7:01p.m. Review ↗
Rust Aug 4, 2026 7:01p.m. Review ↗
Ruby Aug 4, 2026 7:01p.m. Review ↗
Swift Aug 4, 2026 7:01p.m. Review ↗
PHP Aug 4, 2026 7:01p.m. Review ↗
Lua Aug 4, 2026 7:01p.m. Review ↗
Java Aug 4, 2026 7:01p.m. Review ↗
Go Aug 4, 2026 7:01p.m. Review ↗
C & C++ Aug 4, 2026 7:01p.m. Review ↗
Ansible Aug 4, 2026 7:01p.m. Review ↗
Apex Aug 4, 2026 7:01p.m. Review ↗
Elixir Aug 4, 2026 7:01p.m. Review ↗
Groovy Aug 4, 2026 7:01p.m. Review ↗
Objective-C Aug 4, 2026 7:01p.m. Review ↗
PowerShell Aug 4, 2026 7:01p.m. Review ↗
Terraform Aug 4, 2026 7:01p.m. Review ↗
VB.NET Aug 4, 2026 7:01p.m. Review ↗
SQL Aug 4, 2026 7:01p.m. Review ↗
Scala Aug 4, 2026 7:01p.m. Review ↗
Perl Aug 4, 2026 7:01p.m. Review ↗
Kotlin Aug 4, 2026 7:01p.m. Review ↗
Helm Aug 4, 2026 7:01p.m. Review ↗
Erlang Aug 4, 2026 7:01p.m. Review ↗
Dart Aug 4, 2026 7:01p.m. Review ↗
C# Aug 4, 2026 7:01p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

for (const line of lines.slice(-count)) console.log(line)
// slice(-0) === slice(0) returns the whole array, so guard 0 explicitly to
// mean "print no history" (e.g. `logs --tail 0 --follow` to stream only new lines).
for (const line of count === 0 ? [] : lines.slice(-count)) console.log(line)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using console in code that runs on the browser


It is considered a best practice to avoid the use of any console methods in JavaScript code that will run on the browser.

NOTE: If your repository contains a server side project, you can add "nodejs" to the environment property of analyzer meta in .deepsource.toml.
This will prevent this issue from getting raised.
Documentation for the analyzer meta can be found here.
Alternatively, you can silence this issue for your repository as shown here.

If a specific console call is meant to stay for other reasons, you can add a skipcq comment to that line.
This will inform other developers about the reason behind the log's presence, and prevent DeepSource from flagging it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive: this is a CLI command (bolt logs) that intentionally writes log lines to the terminal via console.log; it never runs in a browser. The proper fix is adding "nodejs" to the analyzer environment in .deepsource.toml, not a code change.

// old head messages must survive, since deletion must happen only after a
// summary has been produced. Regression for history-loss on failed compaction.
const result = yield* SessionCompaction.use.process({
parentID: parent!,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forbidden non-null assertion


Using non-null assertions cancels out the benefits of strict null-checking, and introduces the possibility of runtime errors. Avoid non-null assertions unless absolutely necessary. If you still need to use one, write a skipcq comment to explain why it is safe.

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/opencode/src/session/compaction.ts (1)

420-436: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use collection operations for cleanup.

Lines 423-435 use for loops for collection transformation and Effect sequencing. messageIDsToPreserve stores only input.parentID. Build the IDs with collection operations, filter the parent ID, and use sequential Effect.forEach.

Suggested refactor
-        const messageIDsToRemove = new Set<MessageID>()
-        const messageIDsToPreserve = new Set<MessageID>()
-        // Add head messages (summarized in this compaction)
-        for (const msg of selected.head) {
-          messageIDsToRemove.add(msg.info.id)
-        }
-        // Add previously summarized messages (hidden)
-        for (const index of hidden) {
-          messageIDsToRemove.add(history[index].info.id)
-        }
-        // Preserve the parent message (needed as parent of the new compaction message)
-        messageIDsToPreserve.add(input.parentID)
-        for (const msgID of messageIDsToRemove) {
-          if (!messageIDsToPreserve.has(msgID)) {
-            yield* session.removeMessage({ sessionID: input.sessionID, messageID: msgID })
-          }
-        }
+        const messageIDsToRemove = new Set([
+          ...selected.head.map((message) => message.info.id),
+          ...Array.from(hidden, (index) => history[index].info.id),
+        ])
+        yield* Effect.forEach(
+          Array.from(messageIDsToRemove).filter((messageID) => messageID !== input.parentID),
+          (messageID) => session.removeMessage({ sessionID: input.sessionID, messageID }),
+          { concurrency: 1 },
+        )

As per coding guidelines, “Prefer functional array methods such as flatMap, filter, and map over for loops” and “Reduce variable count by inlining values used only once.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opencode/src/session/compaction.ts` around lines 420 - 436, Refactor
the cleanup block around messageIDsToRemove and messageIDsToPreserve to build
removable IDs with collection operations, combining selected.head IDs and hidden
history IDs, then filter out input.parentID directly instead of maintaining a
preservation set. Replace the removal loop with sequential Effect.forEach over
the filtered IDs, preserving the existing session.removeMessage call and
ordering.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/opencode/src/session/compaction.ts`:
- Around line 419-436: Update the cleanup guard surrounding message removal in
SessionProcessor.process() to require !processor.message.error in addition to
the existing conditions, preventing summarized history deletion when processing
stops with an error. Add a regression test covering the error-stop path and
verifying cleanup is skipped.

---

Nitpick comments:
In `@packages/opencode/src/session/compaction.ts`:
- Around line 420-436: Refactor the cleanup block around messageIDsToRemove and
messageIDsToPreserve to build removable IDs with collection operations,
combining selected.head IDs and hidden history IDs, then filter out
input.parentID directly instead of maintaining a preservation set. Replace the
removal loop with sequential Effect.forEach over the filtered IDs, preserving
the existing session.removeMessage call and ordering.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f584fcf2-4a4c-40b2-b579-52d1fab1e114

📥 Commits

Reviewing files that changed from the base of the PR and between 3944bef and bfbfcf0.

📒 Files selected for processing (4)
  • packages/opencode/src/cli/cmd/logs.ts
  • packages/opencode/src/session/compaction.ts
  • packages/opencode/src/session/reminders.ts
  • packages/opencode/test/session/compaction.test.ts

Comment on lines +419 to +436
if (!input.overflow) {
const messageIDsToRemove = new Set<MessageID>()
const messageIDsToPreserve = new Set<MessageID>()
// Add head messages (summarized in this compaction)
for (const msg of selected.head) {
messageIDsToRemove.add(msg.info.id)
}
// Add previously summarized messages (hidden)
for (const index of hidden) {
messageIDsToRemove.add(history[index].info.id)
}
// Preserve the parent message (needed as parent of the new compaction message)
messageIDsToPreserve.add(input.parentID)
for (const msgID of messageIDsToRemove) {
if (!messageIDsToPreserve.has(msgID)) {
yield* session.removeMessage({ sessionID: input.sessionID, messageID: msgID })
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

ast-grep outline packages/opencode/src/session/compaction.ts --items all --type function,variable

rg -n -P --type ts -C 8 \
  '^\s*import\b.*\bSessionProcessor\b|\bSessionProcessor\.Service\b|\bprocessor\.process\s*\(|\bprocessor\.message\.error\b|return\s+"(?:compact|stop|continue)"' \
  packages/opencode/src

rg -n -P --type ts -C 8 \
  '\bcompactionProcessLayer\b|\bCompactionProcessOptions\b|result:\s*"(?:compact|stop|continue)"|message\.error' \
  packages/opencode/test

Repository: bolt-builder/bolt-cli

Length of output: 36326


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- compaction process ---'
sed -n '340,540p' packages/opencode/src/session/compaction.ts

printf '%s\n' '--- processor process implementation ---'
sed -n '600,700p' packages/opencode/src/session/processor.ts

printf '%s\n' '--- compaction tests around failure and cleanup ---'
sed -n '820,940p' packages/opencode/test/session/compaction.test.ts

printf '%s\n' '--- all compaction test processor fakes and cleanup assertions ---'
rg -n -C 6 'function fake|processorLayer|keeps summarized|removeMessage|message\.error|result\)' packages/opencode/test/session/compaction.test.ts

Repository: bolt-builder/bolt-cli

Length of output: 22569


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import re

compaction = Path("packages/opencode/src/session/compaction.ts").read_text()
processor = Path("packages/opencode/src/session/processor.ts").read_text()
tests = Path("packages/opencode/test/session/compaction.test.ts").read_text()

cleanup = re.search(
    r'if \(!input\.overflow\) \{.*?session\.removeMessage\(\{.*?\n\s*\}',
    compaction,
    re.S,
)
error_stop = re.search(
    r'if \(ctx\.blocked \|\| ctx\.assistantMessage\.error\) return "stop"',
    processor,
)
compaction_error_stop = re.search(
    r'if \(processor\.message\.error\) return "stop"',
    compaction,
)
cleanup_pos = compaction.find("session.removeMessage")
error_check_pos = compaction.find("if (processor.message.error) return \"stop\"")
fake_contract = re.search(
    r'function fake\(.*?result: "continue" \| "compact".*?process: .*?Effect\.succeed\(result\)',
    tests,
    re.S,
)

assert cleanup, "cleanup block not found"
assert error_stop, "processor error-to-stop branch not found"
assert compaction_error_stop, "compaction error-to-stop branch not found"
assert cleanup_pos >= 0 and error_check_pos > cleanup_pos, "expected cleanup-before-error ordering not found"
assert fake_contract, "existing fake processor contract not found"

print("processor errors can produce result: stop")
print("compaction cleanup precedes its processor.message.error check")
print("existing compaction fake covers only continue and compact; no stop-with-error case")
PY

Repository: bolt-builder/bolt-cli

Length of output: 346


Gate cleanup on processor.message.error.

When SessionProcessor.process() returns "stop" with an error, cleanup can delete summarized history before the error check. Add !processor.message.error to the guard and cover this path with a regression test.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opencode/src/session/compaction.ts` around lines 419 - 436, Update
the cleanup guard surrounding message removal in SessionProcessor.process() to
require !processor.message.error in addition to the existing conditions,
preventing summarized history deletion when processing stops with an error. Add
a regression test covering the error-stop path and verifying cleanup is skipped.

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/opencode/test/session/compaction.test.ts`:
- Around line 945-968: Update the test around createSummaryCompaction and
SessionCompaction.use.process to first execute a completed summary-generation
call, ensuring the fake processor returns its normal successful result for that
call. Then invoke the stop-path process as the second call and configure the
fake processor to return "stop" only on that second invocation, preserving the
assertions that summarized messages remain available.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 41cf95ab-3ffc-4601-8bf5-15b4392e5a40

📥 Commits

Reviewing files that changed from the base of the PR and between 3e6c5db and 7d0d172.

📒 Files selected for processing (2)
  • packages/opencode/src/session/compaction.ts
  • packages/opencode/test/session/compaction.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/opencode/src/session/compaction.ts

Comment on lines +945 to +968
yield* createSummaryCompaction(session.id)

const msgs = yield* ssn.messages({ sessionID: session.id })
const parent = msgs.at(-1)?.info.id
expect(parent).toBeTruthy()
if (!parent) return

// Processing that stops with an errored assistant message ("stop" +
// message.error) produced no valid summary either, so the summarized
// head messages must survive. Regression for history-loss on errored stop.
const result = yield* SessionCompaction.use.process({
parentID: parent,
messages: msgs,
sessionID: session.id,
auto: true,
})

expect(result).toBe("stop")
const texts = (yield* ssn.messages({ sessionID: session.id }))
.flatMap((msg) => msg.parts)
.flatMap((part) => (part.type === "text" ? [part.text] : []))
expect(texts).toContain("first")
expect(texts).toContain("second")
}).pipe(withCompaction({ result: "stop", config: cfg({ tail_turns: 1, preserve_recent_tokens: 100 }) })),

@coderabbitai coderabbitai Bot Aug 4, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 25 '\bwithCompaction\b|\bprocessorLayer\b|\bcreateSummaryCompaction\b' packages/opencode --glob '*.ts'

Repository: bolt-builder/bolt-cli

Length of output: 50377


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '180,305p' packages/opencode/test/session/compaction.test.ts
printf '\n--- SessionCompaction implementation references ---\n'
rg -n -C 12 'create:|process:|SessionProcessor|\.create\(' packages/opencode/src --glob '*.ts' | head -n 240

Repository: bolt-builder/bolt-cli

Length of output: 22071


🏁 Script executed:

#!/bin/bash
set -euo pipefail

fd -i 'compaction' packages/opencode/src packages/opencode/test | head -n 80
rg -n -C 18 'SessionProcessor|processor\.create|processor\.process|createSummaryCompaction|summary' packages/opencode/src/session packages/opencode/src --glob '*compaction*.ts' --glob '*.ts' | head -n 320

Repository: bolt-builder/bolt-cli

Length of output: 25684


🏁 Script executed:

#!/bin/bash
set -euo pipefail

wc -l packages/opencode/src/session/compaction.ts
ast-grep outline packages/opencode/src/session/compaction.ts
sed -n '1,260p' packages/opencode/src/session/compaction.ts

Repository: bolt-builder/bolt-cli

Length of output: 9728


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '260,588p' packages/opencode/src/session/compaction.ts

Repository: bolt-builder/bolt-cli

Length of output: 12234


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path

test = Path("packages/opencode/test/session/compaction.test.ts").read_text()
impl = Path("packages/opencode/src/session/compaction.ts").read_text()

helper = test[test.index("function createSummaryCompaction"):test.index("function readCompactionPart")]
create = impl[impl.index("const create = Effect.fn"):impl.index("return Service.of", impl.index("const create = Effect.fn"))]
process = impl[impl.index("const processCompaction"):impl.index("const create = Effect.fn")]

print("helper calls SessionCompaction.use.create:", "SessionCompaction.use.create" in helper)
print("helper calls SessionCompaction.use.process:", "SessionCompaction.use.process" in helper)
print("create invokes processors.create:", "processors.create" in create)
print("process invokes processors.create:", "processors.create" in process)
print("stop path preserves messages:", 'if (!input.overflow && !processor.message.error)' in process)
PY

Repository: bolt-builder/bolt-cli

Length of output: 372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

fd -i 'processor' packages/opencode/src/session | head -n 40
rg -n -C 12 'finish\s*=|finish:|return "continue"|return "stop"|interface Interface|create:' packages/opencode/src/session/processor* packages/opencode/src/session --glob '*.ts' | head -n 260

Repository: bolt-builder/bolt-cli

Length of output: 20578


Seed a completed summary before testing the stop path.

createSummaryCompaction only creates a compaction marker. It does not create a summary. Add a completed summary message before invoking process with "stop", and make the fake processor return "stop" only for that second call.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opencode/test/session/compaction.test.ts` around lines 945 - 968,
Update the test around createSummaryCompaction and SessionCompaction.use.process
to first execute a completed summary-generation call, ensuring the fake
processor returns its normal successful result for that call. Then invoke the
stop-path process as the second call and configure the fake processor to return
"stop" only on that second invocation, preserving the assertions that summarized
messages remain available.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test exercises the cleanup guard within a single process call: the fake sets message.error and returns "stop", and the deletion candidates are the seeded head turns from selected.head, not a prior summary. Seeding a completed summary first and stopping only on a second call would exercise the same guard with extra machinery, mirroring the adjacent pre-verified regression test's seeding pattern.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped: comment is from another GitHub bot.

@DevFlex-AI
DevFlex-AI merged commit b6de29d into dev Aug 4, 2026
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant