Skip to content

fix(native-chat): main typechecks again — report a failed stop-child through the host logger - #24438

Closed
brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/fix-codex-stop-child-logger
Closed

brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/fix-codex-stop-child-logger

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

What this fixes

main no longer typechecks, so every open PR's CI is red (CI typechecks each PR merged with main).

Why: #24312 replaced the structured chat host's optional onEventSinkError callback with a required logger. Two PRs written before it landed after it, and each passed CI on its own:

Scope: build only. No user-facing change: the failure is now written to the host's diagnostics log (the same place #24312 sends every other structured chat failure) instead of to a callback that no longer exists.

What changed

  • structured-agent-session-chat-stop.ts: the failed stop-child is reported with context.deps.logger.warn(…, { scope: 'chat-stop', sessionId, error }), matching the neighbouring wind-down failure in the same file.
  • structured-agent-session-conversation-stop.test.ts: asserts the logger's warn instead of the removed callback.
  • structured-agent-session-repeat-press.test.ts, structured-agent-session-repeated-stop.test.ts: pass the host its required logger.

Testing

  • tsc --noEmit -p config/tsconfig.node.json on this branch: passes (it fails on main at 56c7642 with TS2339 / TS2741 in exactly these files).
  • Vitest: the conversation-stop, Codex stop-row, repeat-press and repeated-stop files, 53 tests pass.
  • oxlint, oxfmt and the anti-slop audit on the changed files: clean.

Visual Proof

N/A: build fix with no UI change.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A screenshots (no UI change)
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote impact considered (none)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

#24334 and #24301 landed after #24312 replaced the host's onEventSinkError callback with a required logger, so main no longer typechecks.
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes error handling for a child process stop failure.

The PR appears safe to merge; no actionable issue was identified.

Summary

The PR restores typechecking by routing failed stop-child reporting through the host logger and supplying required loggers to two test hosts.

  • Updates the conversation-stop tests to assert the warning instead of the removed callback.
  • No actionable regression was identified.

Reviews (1) · Last reviewed commit: "fix(native-chat): report a failed stop-c..."

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — full diff of the single commit 5270ee1a67 (4 files).

  • Failed stop-child now goes to the host logger — structured-agent-session-chat-stop.ts reports a failed post-interrupt child end with context.deps.logger.warn(…, { scope: 'chat-stop', sessionId, error }), matching the neighbouring wind-down failure in the same function.
  • Test asserts the logger — structured-agent-session-conversation-stop.test.ts replaces the removed onEventSinkError mock with a warn mock and asserts the chat-stop scope/sessionId.
  • Required logger passed — structured-agent-session-repeat-press.test.ts and structured-agent-session-repeated-stop.test.ts now build the host with the required logger.

Verified on the branch: pnpm tc:node passes, and the three touched test files pass (35 tests). Logging through the never-throwing logger preserves the invariant that reporting cannot fail the operation, and onStopChildError stays optional in performCancel.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 64dd0457-91e5-4587-a6d6-ef0d3450e0cb

📥 Commits

Reviewing files that changed from the base of the PR and between 56c7642 and 5270ee1.

📒 Files selected for processing (4)
  • src/main/native-chat/agent-session-wire/structured-agent-session-chat-stop.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-conversation-stop.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-repeat-press.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-repeated-stop.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

During chat Stop, the child-error callback now logs a warning with the chat-stop scope and session ID instead of forwarding the error to the optional event-sink handler. Conversation-stop tests check the warning for child-close failures. Repeat-press and repeated-stop tests now provide a structured agent-session logger to host setup.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 5270e

Child-stop errors now use the structured warning path, whose production logger is guarded against throwing. No remaining issue blocks merging; normal checks still apply.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the typecheck fix and the change to report failed stop-child operations through the host logger.
Description check ✅ Passed The description is detailed and covers the cause, scope, implementation, testing, visual proof, and checklist. It does not include an explicit Fixes # entry or several template sections, but the ava…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch brennanb2025/fix-codex-stop-child-logger
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Superseded by #24437 (9bcdb6a), which landed first with the same fix: the failed Stop child end now reports through the host logger, and the three stale tests pass the required logger. Verified main typechecks at 197ea3a (tsc --noEmit -p config/tsconfig.node.json, 0 errors).

@brennanb2025
brennanb2025 deleted the brennanb2025/fix-codex-stop-child-logger branch October 1, 2026 18:55
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