Skip to content

fix: restore goal accounting after thread resume#24626

Merged
jif-oai merged 1 commit into
mainfrom
jif/goal-resume
May 26, 2026
Merged

fix: restore goal accounting after thread resume#24626
jif-oai merged 1 commit into
mainfrom
jif/goal-resume

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 26, 2026

Why

Goal idle accounting is supposed to survive a thread resume. Previously, the resume hook restored the active goal state inline from the extension lifecycle contributor, which left the runtime handle without a reusable restoration path and made the behavior hard to cover directly. When a thread with an active goal was resumed, goal accounting could lose track of the active idle goal instead of continuing to accrue elapsed time.

What changed

  • Moved thread-resume restoration into GoalRuntimeHandle::restore_after_resume() so the runtime owns rehydrating active goal accounting from persisted thread goal state.
  • Kept disabled goal runtimes as a no-op and preserved the existing warning path when persisted goal state cannot be loaded.
  • Added a backend regression test that seeds an active goal, resumes the thread, waits briefly, and verifies elapsed idle time is reflected on the next external goal mutation.

Testing

  • Not run locally; this metadata update only rewrote the PR title/body.

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 26, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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".

@jif-oai jif-oai changed the title feat: goal resume handling fix: restore goal accounting after thread resume May 26, 2026
@jif-oai jif-oai merged commit 823381e into main May 26, 2026
30 checks passed
@jif-oai jif-oai deleted the jif/goal-resume branch May 26, 2026 18:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
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.

1 participant