Skip to content

Record Windows sandbox service stop diagnostics - #50507

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/d0d39d091410e2b5499a0803475804d12235f836
Oct 3, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/d0d39d091410e2b5499a0803475804d12235f836

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Record Windows sandbox service stop diagnostics

What changed

Persist the service's last reported lifecycle reason and numeric HRESULT in the existing service registry key. Distinguish requested stops, shutdown, owner removal, startup failure, broker failure, and interrupted registration, and reset the record on startup. Recording is best-effort and does not affect the service lifecycle.

Emit codex.windows_sandbox.service_stopped when a provisioning client observes a stopped service, including the recorded reason, HRESULT, and Windows service exit codes. Recheck the service status and registry record before emitting to avoid pairing inconsistent evidence during a concurrent restart. The metric counts observations, not unique outages; the recorded reason is advisory.

Update the cached service status only after SetServiceStatus succeeds. Extract diagnostic error codes from typed errors without collecting error text or user data.

Testing

Add a test covering Win32-to-HRESULT conversion, preservation of Windows HRESULTs through error context, and a zero fallback for untyped error text.

## What changed

Persist the service's last reported lifecycle reason and numeric HRESULT in the existing service registry key. Distinguish requested stops, shutdown, owner removal, startup failure, broker failure, and interrupted registration, and reset the record on startup. Recording is best-effort and does not affect the service lifecycle.

Emit `codex.windows_sandbox.service_stopped` when a provisioning client observes a stopped service, including the recorded reason, HRESULT, and Windows service exit codes. Recheck the service status and registry record before emitting to avoid pairing inconsistent evidence during a concurrent restart. The metric counts observations, not unique outages; the recorded reason is advisory.

Update the cached service status only after `SetServiceStatus` succeeds. Extract diagnostic error codes from typed errors without collecting error text or user data.

## Testing

Add a test covering Win32-to-HRESULT conversion, preservation of Windows HRESULTs through error context, and a zero fallback for untyped error text.

GitOrigin-RevId: d0d39d091410e2b5499a0803475804d12235f836
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/d0d39d091410e2b5499a0803475804d12235f836 branch from 2d970ba to c542fb9 Compare October 3, 2026 03:20
@copyberry
copyberry Bot merged commit c542fb9 into main Oct 3, 2026
12 of 18 checks passed
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/d0d39d091410e2b5499a0803475804d12235f836 branch October 3, 2026 03:20
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2026
@zfd03
zfd03 deployed to issue-triage October 3, 2026 03:24 — with GitHub Actions Active
@zfd03
zfd03 deployed to issue-triage October 3, 2026 03:24 — with GitHub Actions Active
@zfd03
zfd03 deployed to issue-triage October 3, 2026 03:24 — with GitHub Actions Active
@QilyLiA7
QilyLiA7 deployed to issue-triage October 3, 2026 03:28 — with GitHub Actions Active
@QilyLiA7
QilyLiA7 deployed to issue-triage October 3, 2026 03:28 — with GitHub Actions Active
@QilyLiA7
QilyLiA7 deployed to issue-triage October 3, 2026 03:28 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — c542fb93 Deployed Oct 3, 2026 by QilyLiA7 via Translate non-English issue #17070
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.

3 participants