Skip to content

fix: Request-scoped session exposes no post-commit hook, so module caches refresh against uncommitted state - #278

Merged
antosubash merged 2 commits into
mainfrom
pi/issue-268-request-scoped-session-exposes-no-post-c
Sep 4, 2026
Merged

fix: Request-scoped session exposes no post-commit hook, so module caches refresh against uncommitted state#278
antosubash merged 2 commits into
mainfrom
pi/issue-268-request-scoped-session-exposes-no-post-c

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Closes #268

Headless Pi worker

This is a draft pull request created from an issue carrying the approval label.
It is never merged automatically and requires human review.

Agent summary

Summary

  • Added RequestSession.on_commit(callback) supporting sync and async callbacks.
  • Callbacks run only after successful commits; rollback/read-only/failed commits discard them.
  • Callback failures are logged without affecting committed responses or later callbacks.
  • Exported the new session/callback types and documented usage.

Changed areas

  • DB session/finalization runtime
  • Framework DB public API
  • Session documentation and changelog
  • Transaction/session tests

Verification

  • uv run pytest framework/db/tests69 passed
  • Ruff format/check — passed
  • uv run ty check ...passed
  • uv run python scripts/check_file_size.pypassed
  • git diff --checkpassed

Visual evidence: none required.

Risks/blockers: none.

Local visual evidence

When requested, screenshots, traces, videos, and GIFs are stored only under the worker worktree's ignored
.qa/issues/268/ directory. GitHub CLI cannot attach those files; inspect them on the worker host
or attach selected evidence manually.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: fab80a8
Status: ✅  Deploy successful!
Preview URL: https://0cd17bf4.simple-module-python.pages.dev
Branch Preview URL: https://pi-issue-268-request-scoped.simple-module-python.pages.dev

View logs

@antosubash

Copy link
Copy Markdown
Owner Author

✅ CI checks passed for this pull request.

@antosubash antosubash added bug Something isn't working pi-pr-open The headless Pi worker opened a draft pull request labels Aug 30, 2026
@antosubash

Copy link
Copy Markdown
Owner Author

✅ CI checks passed for this pull request.

@antosubash
antosubash marked this pull request as ready for review September 4, 2026 21:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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
🔒 Security Review Completed 2026-09-04T21:15:58.267057Z fab80a8 Draft marked ready
ℹ️ 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.

@antosubash
antosubash merged commit 4a3e588 into main Sep 4, 2026
13 checks passed
@antosubash
antosubash deleted the pi/issue-268-request-scoped-session-exposes-no-post-c branch September 4, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pi-pr-open The headless Pi worker opened a draft pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request-scoped session exposes no post-commit hook, so module caches refresh against uncommitted state

1 participant