Skip to content

fix(server): preserve sanitized reply-write diagnostics - #251

Merged
KooshaPari merged 2 commits into
codex/mcp-owned-lifecycle-20261103from
codex/client-pipe-error-context-20261105
Nov 11, 2026
Merged

KooshaPari merged 2 commits into
codex/mcp-owned-lifecycle-20261103from
codex/client-pipe-error-context-20261105

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

User description

Reply-write failures lacked request/operation context, and a bare operation marker could hide native details in paths without the initial-control wrapper. Preserve the fixed operation, IO error kind, and numeric OS code in the top-level error. Initial lightweight-control failures also include decoded request kind and numeric correlation ID. The original IO cause remains available for downcasting; the runtime logger does not expand arbitrary error chains.

Validation on Windows with jcode-app-core default features disabled: four focused tests passed.

  • Real private-pipe Ping -> handle_client -> runtime file log: successful Pong control, gated peer-close failure, sanitized request/operation/kind/code, private payload omission, and client/session cleanup. The observed error was BrokenPipe / OS 232 for request 101.
  • Native transport writer: successful Ack, explicit server-side closure observation, failed reply metadata, and preserved IO cause.
  • Privacy sentinels: private IO/context/handler messages omitted from summaries.
  • Unwrapped writer context: native numeric code retained without arbitrary error text.

Formatting and whitespace checks passed; independent source review found no actionable blocker. The initial writer fixture assumed dropping the peer immediately makes the next write fail; Windows accepted that write. Its failure log is retained, and the corrected fixture observes closure before asserting failure.

Full handler/log acceptance is limited to Ping. Other request paths and logging sites that format complete error chains are outside this integration proof. Default-feature/full-suite and cross-platform validation remain unexecuted. No live service, installation, or deployment was changed.

Stacked on the fork branch backing 1jehuang#2062. This PR remains a draft.


Tracks #271 (residual agent PR backlog): the Require Linked Issue gate failed only because this PR predates the issue.


CodeAnt-AI Description

Preserve safe request details in pipe failure logs

What Changed

  • Failed lightweight control requests now include the request type and ID, the failed operation, and safe I/O error details in runtime logs.
  • Failure logs omit arbitrary private error messages while retaining the underlying I/O cause.

Impact

✅ Easier diagnosis of failed control requests
✅ Private error messages stay out of logs
✅ Pipe failures retain operating-system error details

💡 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.

@coderabbitai

coderabbitai Bot commented Nov 5, 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d2147ca3-d8ed-42c2-bfb7-b1bcb63839fb
Commits

Reviewing files that changed from the base of the PR and between 47725bf and f38d159.

Files selected for processing: 6

  • crates/jcode-app-core/src/server.rs
  • crates/jcode-app-core/src/server/client_error_context.rs
  • crates/jcode-app-core/src/server/client_lifecycle.rs
  • crates/jcode-app-core/src/server/client_writer.rs
  • crates/jcode-app-core/src/server/runtime.rs
  • crates/jcode-app-core/src/server/runtime_error_tests.rs
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • 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

@KooshaPari KooshaPari changed the title fix(server): retain sanitized lightweight pipe error context fix(server): preserve sanitized reply-write diagnostics Nov 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@KooshaPari
KooshaPari marked this pull request as ready for review November 11, 2026 13:16
Copilot AI balanced review requested due to automatic review settings November 11, 2026 13:16
@KooshaPari
KooshaPari merged commit 506d49e into codex/mcp-owned-lifecycle-20261103 Nov 11, 2026
9 of 15 checks passed
@KooshaPari
KooshaPari deleted the codex/client-pipe-error-context-20261105 branch November 11, 2026 13:16
@codeant-ai

codeant-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #62eed Reviewed your PR f38d159 Nov 11, 2026 · 13:16 13:23

@codeant-ai

codeant-ai Bot commented Nov 11, 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

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 insufficient remaining quota. Try requesting a review at a lower effort level.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Nov 11, 2026
@codeant-ai

codeant-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

1 code suggestion

1. This checks only the IO kind, so the runtime-log test passes even when the promised numeric OS code is missing or rendered as None.

Incomplete implementation · crates/jcode-app-core/src/server/runtime_error_tests.rs:176

@kilo-code-bot

kilo-code-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • crates/jcode-app-core/src/server.rs - no issues
  • crates/jcode-app-core/src/server/client_error_context.rs - no issues
  • crates/jcode-app-core/src/server/client_lifecycle.rs - no issues
  • crates/jcode-app-core/src/server/client_writer.rs - no issues
  • crates/jcode-app-core/src/server/runtime.rs - no issues
  • crates/jcode-app-core/src/server/runtime_error_tests.rs - no issues

Reviewed by free · Input: 68.9K · Output: 2.7K · Cached: 165.9K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants