Skip to content

fix(hooks): align SessionEnd timeout with Codex runtime cap - #755

Open
james-meneses wants to merge 2 commits into
openai:mainfrom
james-meneses:fix/session-end-codex-timeout
Open

fix(hooks): align SessionEnd timeout with Codex runtime cap#755
james-meneses wants to merge 2 commits into
openai:mainfrom
james-meneses:fix/session-end-codex-timeout

Conversation

@james-meneses

@james-meneses james-meneses commented Sep 9, 2026

Copy link
Copy Markdown

Summary

  • set the SessionEnd hook timeout to the runtime hard cap of 3 seconds
  • bound the broker shutdown request at 750 ms so teardown stays inside that budget
  • add focused manifest and non-responsive-broker regression tests

Evidence

  • RED manifest: SessionEnd timeout 5s exceeds the runtime 3s hard cap
  • RED stalled broker: focused test remained pending until external timeout, rc=124
  • node --test tests/broker-lifecycle.test.mjs tests/hooks.test.mjs: 2 pass
  • npm test: 93 pass
  • Desktop 0.153.4 hooks/list, before: effective timeoutSec: 3 plus the clamp warning
  • fresh isolated home from this head, after: effective timeoutSec: 3, warnings: [], errors: [] in two project roots

Why

The runtime enforces SESSION_END_MAX_TIMEOUT_SEC = 3 to retain headroom inside its five-second app-server shutdown bound. A plugin value of 5 is valid input but is always clamped, producing a warning in every project where the globally enabled plugin is loaded. The prior shutdown request could also wait indefinitely after a broker accepted without replying, so lowering only the manifest value would create a false-green contract.

Scope

This bounds the request and removes the manifest/runtime mismatch. It does not change shared-broker ownership or cross-session shutdown policy.

Related: #474, #540, #671

Keep the plugin manifest within the runtime teardown budget so loading
the lifecycle hook does not emit a clamp warning. Add a regression test
that binds the manifest to the three-second runtime ceiling.

Authored-By: kyros-architect-harness
Dispatch-Id: desktop_sessionend_clamp
Refs: openai#474
@james-meneses
james-meneses requested a review from a team September 9, 2026 17:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-09-09T17:39:36.311348Z e116f42 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Return from session teardown when a broker accepts the shutdown request
but never responds. Keep the internal bound below the manifest budget.

Authored-By: kyros-architect-harness
Dispatch-Id: desktop_sessionend_clamp
Refs: openai#755
@james-meneses

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Provided git ref e116f4277ac8d164340ee06a0253f20ac0e4854b does not exist
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants