Skip to content

🩹 fix(codeapi): add session cache recovery utility - #60

Merged
danny-avila merged 2 commits into
mainfrom
rlazar/session-cache-recovery
Aug 26, 2026
Merged

🩹 fix(codeapi): add session cache recovery utility#60
danny-avila merged 2 commits into
mainfrom
rlazar/session-cache-recovery

Conversation

@upman

@upman upman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dry-run-first utility for restoring expired Redis session:<session_id> ownership keys from a trusted JSONL manifest.

  • Requires environment, region, and namespace through CLI arguments or SESSION_RECOVERY_* configuration.
  • Verifies the manifest source header against that configured scope before connecting to Redis.
  • Uses SET NX EX so apply never overwrites an existing owner.
  • Reports conflicts, incomplete races, TTL, and partial progress after an interrupted Redis operation.
  • Packages the utility in the API images at /app/.build-migrations/rehydrate-session-cache.js.

Recovery manifests and deployment runbooks remain outside this repository.

Verification

  • bunx eslint scripts/rehydrate-session-cache.ts src/rehydrate-session-cache.test.ts
  • bun test src/rehydrate-session-cache.test.ts — 11 passed
  • Production-target Bun bundle succeeds
  • Full service suite: 558 passed; one unrelated timing-sensitive test failed and passed on focused rerun

Calldiff

calldiff diff HEAD --file service/scripts/rehydrate-session-cache.ts --maxDepth 4 --locs

+ main(args)
+ ├─ parseOptions(args, env)
+ ├─ readInput(inputPath)
+ ├─ parseRecoveryManifest(input, expected)
+ │  └─ parseRecoverySource(value, expected)
+ ├─ createRedisClient()
+ └─ recoverSessionCache(records, store, options)
+    ├─ store.get()
+    ├─ store.set()
+    └─ new RecoveryInterruptedError(error, summary)

@upman

upman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

1 similar comment
@upman

upman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c553eb167

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

Comment thread service/scripts/rehydrate-session-cache.ts Outdated
@upman

upman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 3a21c888ed

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

@upman upman changed the title fix(codeapi): add session cache recovery utility 🩹 fix(codeapi): add session cache recovery utility Aug 25, 2026
@upman
upman requested a review from danny-avila August 25, 2026 14:18
@danny-avila
danny-avila merged commit 297fead into main Aug 26, 2026
5 checks passed
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