Skip to content

Run compact session-start hooks before turn continuation - #34396

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/c57708a792fb47d98d95c38d7d91bcd9f235be84
Jul 20, 2026
Merged

Run compact session-start hooks before turn continuation#34396
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/c57708a792fb47d98d95c38d7d91bcd9f235be84

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 20, 2026

Copy link
Copy Markdown

Run compact session-start hooks before turn continuation

Why

Mid-turn auto-compaction queued SessionStart hooks but continued sampling
before running them. This delayed hook-provided context and ignored requests to
stop the continuation.

What changed

Drain pending session-start hooks immediately after successful mid-turn
auto-compaction. End the turn when a hook requests a stop; otherwise include
its additional context in the next sampling request.

Testing

Added coverage for repeated compactions in one turn, context delivery without
leaking hooks into the next user turn, and stop requests that block sampling.

## Why

Mid-turn auto-compaction queued `SessionStart` hooks but continued sampling
before running them. This delayed hook-provided context and ignored requests to
stop the continuation.

## What changed

Drain pending session-start hooks immediately after successful mid-turn
auto-compaction. End the turn when a hook requests a stop; otherwise include
its additional context in the next sampling request.

## Testing

Added coverage for repeated compactions in one turn, context delivery without
leaking hooks into the next user turn, and stop requests that block sampling.

GitOrigin-RevId: c57708a792fb47d98d95c38d7d91bcd9f235be84
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/c57708a792fb47d98d95c38d7d91bcd9f235be84 branch from 3e260e4 to 8c41ed3 Compare July 20, 2026 19:10
@copyberry
copyberry Bot merged commit 8c41ed3 into main Jul 20, 2026
18 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/c57708a792fb47d98d95c38d7d91bcd9f235be84 branch July 20, 2026 19:11
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 20, 2026
@ohyeh
ohyeh temporarily deployed to issue-triage July 20, 2026 19:18 — with GitHub Actions Inactive
@ohyeh
ohyeh temporarily deployed to issue-triage July 20, 2026 19:18 — with GitHub Actions Inactive
@ohyeh
ohyeh temporarily deployed to issue-triage July 20, 2026 19:18 — with GitHub Actions Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants