Skip to content

fix(fork): clear the warning-budget regression from the swallowed-error fix - #81

Merged
KooshaPari merged 1 commit into
revert/pr-33-mergefrom
fix/fork-warning-budget
Oct 15, 2026
Merged

KooshaPari merged 1 commit into
revert/pr-33-mergefrom
fix/fork-warning-budget

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

The same drop(...)-on-Copy problem the upstream audit found in #77's follow-up also exists on the fork from #79. check_warning_budget.sh on the fork goes 0 -> 4, and that gate was never run during the #79 work.

Fix

  • the two background-sender closures name the delivery call directly instead of wrapping a Copy bool in drop
  • the detached blocking thread handles its SendError with a debug log rather than discarding it
  • the session-restore fallback warning now includes the underlying error, so if let Err(e) has a real use instead of having been renamed to _e

That last one is a small behaviour improvement: the log now says why the saved model was unavailable, which is exactly what made the original bug hard to diagnose.

Validation

Gate Result
check_warning_budget.sh OK current=0 baseline=0
check_panic_budget PASS (77 -> 61)
cargo check -q (workspace) 0 warnings
check_module_files / check_dependency_boundaries / check_wildcard_reexport_budget PASS

Pre-existing failures, not in this diff

None of those files are in this diff.

Ledger

tx-agent: jcode
tx-task: panic-budget-ratchet
tx-validated: cargo-check
tx-scope: crates/jcode-app-core/src/agent/turn_execution.rs, crates/jcode-telemetry-core/src/lib.rs
tx-intent: restore the fork warning budget to zero after the swallowed-error gate fix

CodeAnt-AI Description

Show why a saved session model could not be restored

What Changed

  • When a saved model is unavailable, the fallback warning now includes the reason.
  • A debug message is logged if the telemetry result cannot be returned to its waiting caller.

Impact

✅ Clearer saved-model fallback diagnostics
✅ Debug visibility when telemetry results cannot be returned

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…or fix

The #79 swallowed-error fix traded one gate for another: `drop(...)` on a
`Copy` bool does nothing, so `check_warning_budget.sh` went 0 -> 4. That
gate was not run during the #79 work; this audit found it.

- the two background-sender closures name the delivery call directly
  instead of wrapping a `Copy` bool in `drop`
- the detached blocking thread handles its `SendError` with a debug log
  rather than discarding it
- the session-restore fallback warning now includes the underlying error,
  so `if let Err(e)` has a real use instead of being renamed to `_e`

Validation:
  scripts/check_warning_budget.sh          -> OK current=0 baseline=0
  check_panic_budget.py                    -> PASS (77 -> 61)
  cargo check -q (workspace)               -> 0 warnings

The fork's remaining swallowed-error (3248 -> 3454) and test/code-size
failures are pre-existing and are not in this diff.

tx-agent: jcode
tx-task: panic-budget-ratchet
tx-validated: cargo-check
tx-scope: crates/jcode-app-core/src/agent/turn_execution.rs, crates/jcode-telemetry-core/src/lib.rs
tx-intent: restore the fork warning budget to zero after the swallowed-error gate fix
Copilot AI balanced review requested due to automatic review settings October 15, 2026 08:32
@codeant-ai

codeant-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 26a3b73 Oct 15, 2026 · 08:32 08:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5d19518c-85fc-4eae-a240-a8d4c9756ed1
📥 Commits

Reviewing files that changed from the base of the PR and between 84855e6 and 26a3b73.

📒 Files selected for processing: 2
  • crates/jcode-app-core/src/agent/turn_execution.rs
  • crates/jcode-telemetry-core/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 15, 2026
@KooshaPari
KooshaPari merged commit 1beac4b into revert/pr-33-merge Oct 15, 2026
6 checks passed
@codeant-ai

codeant-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. The comment says both results are unused, but post_payload's boolean is sent through tx and read by the worker's caller.

Comment mismatch · crates/jcode-telemetry-core/src/lib.rs:1522-1525

.name("jcode-telemetry-blocking".to_string())
.spawn(move || {
drop(tx.send(post_payload(payload_for_thread, timeout)));
// Both results are unused here: the worker's caller

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Inaccurate comment

The comment states "Both results are unused here" but this is misleading. The post_payload boolean result IS sent through the channel (tx.send(...)) and read by the caller via rx.recv_timeout(timeout).unwrap_or(false). Only the SendError (if send fails) is handled locally. Suggest updating the comment to clarify what's actually unused.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
crates/jcode-telemetry-core/src/lib.rs 1522 Inaccurate comment — claims "Both results are unused" but post_payload's boolean is sent via channel and read by caller
Files Reviewed (2 files)
  • crates/jcode-app-core/src/agent/turn_execution.rs - 0 issues
  • crates/jcode-telemetry-core/src/lib.rs - 1 issue

Review Notes

The PR correctly fixes the warning-budget regression from PR #79 by:

  • Removing drop() wrappers on Copy bool returns in background sender closures (the actual fix for the budget)
  • Adding proper error handling with debug logging for the blocking send path
  • Including the underlying error in the session-restore fallback warning (behavior improvement)
  • Fixing pre-existing indentation bugs in turn_execution.rs

All changes are minimal and targeted. The only issue is the misleading comment at line 1522 in telemetry-core/src/lib.rs which should be corrected to accurately reflect that the post_payload result IS used (sent through the channel), while only the SendError from a failed send is handled locally.

Fix these issues in Kilo Cloud


Reviewed by free · Input: 144.1K · Output: 3.9K · Cached: 241.9K

KooshaPari added a commit that referenced this pull request Oct 16, 2026
…nded (#86)

The minutes-exhausted claim is false: a private repo completed a run the same night, and this public repo's dispatch API returns 422 while permissions still say enabled.

tx-agent: jcode
tx-validated: manual
tx-task: ownership-sunset
tx-scope: docs/PROJECT_OWNERSHIP_HANDOFF.md
tx-intent: stop the next agent from treating a billing outage or a master landing that did not happen
@KooshaPari
KooshaPari deleted the fix/fork-warning-budget branch November 29, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants