Skip to content

chore: isolate thread goal storage behind GoalStore#23295

Merged
jif-oai merged 1 commit into
mainfrom
jif/prep-goal-db
May 18, 2026
Merged

chore: isolate thread goal storage behind GoalStore#23295
jif-oai merged 1 commit into
mainfrom
jif/prep-goal-db

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

Thread goal persistence is being prepared for a dedicated storage boundary. Before that split, goal-specific reads, writes, accounting, and cleanup were exposed directly on StateRuntime, so core and app-server callsites stayed coupled to the full runtime instead of a goal-specific store.

This PR introduces that boundary without changing the goal wire API or current persistence behavior. Callers now go through StateRuntime::thread_goals() and the new GoalStore, while GoalStore still uses the existing state DB pool underneath.

What changed

  • Added GoalStore in state/src/runtime/goals.rs and exposed it from StateRuntime via thread_goals().
  • Moved thread-goal reads, writes, status updates, pause, delete, and usage accounting onto GoalStore.
  • Updated core session goal handling, app-server goal RPCs, resume snapshots, and goal tests to use the store boundary.
  • Kept thread deletion responsible for cascading goal cleanup by deleting the goal through the store only after a thread row is removed.

Testing

  • Existing goal persistence, resume, and accounting tests were updated to exercise the new GoalStore access path.

@jif-oai jif-oai requested a review from a team as a code owner May 18, 2026 12:09
@jif-oai jif-oai changed the title chore: prep for goal DB chore: isolate thread goal storage behind GoalStore May 18, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 18, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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 merged commit 7ee7fe2 into main May 18, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/prep-goal-db branch May 18, 2026 12:47
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 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