Skip to content

refactor: colocate structured session cancellation contract - #33048

Merged
nwparker merged 1 commit into
mainfrom
nwparker/structured-session-stop-contract
Oct 24, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/structured-session-stop-contract

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Move the session cancellation type signature beside the other Stop methods so the adapter stays within the repository file-length limit.

What Changed

cancelTurn now belongs to the existing Stop contract that StructuredAgentSessionAdapter intersects. The complete Adapter retains the same 38 members; Stop gains the required cancellation method. Both files emit byte-identical runtime JavaScript.

Why

Current main exceeds the adapter file-length limit and blocks the socket-cleanup PR's CI. This places the existing signature with its cancellation outcome and prompt-stop methods.

Linked Issue

Prerequisite for #33042.

Visual Proof

N/A — type ownership only; no rendered or runtime behavior changes.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Full repository oxlint, desktop/CLI/web typechecks, process-host build, changed-code quality, formatting, and 150 reliability gates pass. Runtime JavaScript and all six existing runtime bodies are identical, so no new runtime tests were added. Full CI passes, including unit tests, mobile verification, Linux and Windows packaging, WSL, headless-server persistence and cross-version wire compatibility.

Review

Two independent native Codex source audits verify contract and runtime conservation. Fresh-main integration is checked before merge.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No changes to platform, remote/mobile wire formats, workspace routing, security or performance.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A visual proof with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Applicable local validation and full CI pass

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4634d469-bd79-46fc-9777-ca804d353953
Commits

Reviewing files that changed from the base of the PR and between a75cdc8 and 09c14c7.

Files selected for processing: 2
  • src/main/native-chat/agent-session-wire/structured-agent-session-adapter-stop.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts

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

Walkthrough

cancelTurn is now declared on StructuredAgentSessionAdapterStop instead of StructuredAgentSessionAdapter. The method retains its session, fence, optional turn and prompt, stop timing, dispatch state, and live-turn resolution inputs, and returns AgentSessionCancelOutcome. Related imports were updated.

Priority: Low

Merge Risk: Minimal · up to 09c14

The cancellation contract remains available through the adapter’s stop interface; no merge-blocking issue is identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: moving the structured session cancellation contract to the appropriate interface.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Description check Passed The description covers the required sections and clearly explains the type-only change, rationale, testing, review, and compatibility impact. The Linked Issue section names #33042 but does not include…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description covers the required sections and clearly explains the type-only change, rationale, testing, review, and compatibility impact. The Linked Issue section names #33042 but does not include an actual issue link or use the requested Fixes format. The AI Disclosure section is empty, which is acceptable if the author is an internal contributor.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • 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.

@nwparker
nwparker merged commit 92ccacd into main Oct 24, 2026
40 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