Skip to content

fix: harden diff cache, readiness probes, and OpenAI reasoning effort - #219

Merged
devarshishimpi merged 1 commit into
mainfrom
fix/followup-prs-201-202-203
Nov 29, 2026
Merged

devarshishimpi merged 1 commit into
mainfrom
fix/followup-prs-201-202-203

Conversation

@devarshishimpi

Copy link
Copy Markdown
Owner

Summary

Follow-up hardening and review-feedback fixes for merged PRs #201 (#177), #202 (#173), and #203 (#181):

Diff Cache (#203 / #181)

  • Extract shared getOrFetchCachedDiff helper in packages/core/src/review/diff-cache.ts using cached != null so empty diffs ("") cache properly instead of re-fetching on every call.
  • Validate non-empty commit SHAs (!previousCommitSha?.trim() || !newHeadSha?.trim()) in getIncrementalDiffFiles and document PR-level context responsibilities (PR title, description, suppressed findings) in JSDoc.
  • Add empty-diff caching, empty-SHA rejection, and skipped count assertions in test/review/diff-cache.spec.ts.

Readiness Probe & Observability (#202 / #173)

  • Move runtime probes into apps/worker/src/api-deps.ts (SELECT clock_timestamp() to bypass Hyperdrive SQL caching + APP_KV.get) and apps/node/src/api-deps.ts / apps/node/src/index.ts (PING_REDIS checking redisClient.status === "ready" before ping() to prevent ioredis offline-queue buildup, with WeakMap probe memoization).
  • Add in-flight probe coalescing (activeProbes WeakMap), ProbeTimeoutError classification, .unref?.() timer cleanup, and late-rejection suppression in packages/api/src/routes/health.ts.
  • Keep logger.runWithContext(...) active in packages/api/src/middleware/observability.ts while suppressing info access logs for exact GET/HEAD requests to /health and /health/ready, preserving requestId on failure warnings.
  • Update docs/docker.mdx (timeoutSeconds: 3, explicit livenessProbe vs readinessProbe, Docker restart behavior note) and docs/nodejs.mdx.
  • Add wiring, coalescing, late-rejection, observability, and Cache-Control: no-store tests in test/health-ready.spec.ts.

OpenAI Reasoning Effort & Model Profiles (#201 / #177)

  • Guard reasoningEffortFor against non-finite/negative numeric values, exclude o1-mini / o1-preview from receiving reasoning_effort, and spread declaratively in packages/models/src/providers/openai.ts.
  • Simplify ModelSamplingConfigSchema.thinkingBudget with z.enum(...) in packages/schema/src/schema-model-registry.ts and document Gemini fallback behavior in profile-sampling.ts.
  • Move and expand tests into packages/models/test/providers/openai.test.ts using ModelProfileSchema.parse and ModelRegistryService spies (removing test/openai-reasoning-effort.spec.ts).

@codra-app-personal codra-app-personal 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.

Codra Review

✅ Nothing to flag. Reviewed 17 files (931 changed lines) and found no issues worth raising.

Note

1 candidate did not survive the evidence and claim gates — see the dashboard for what was dropped and why.

Reviewed commit: 767f6929cb

ℹ️ About Codra in GitHub

Your team has set up Codra to review pull requests in this repo. Reviews are triggered when you:

  • Open a pull request for review
  • Mark a draft as ready

Every review posts a summary here. A clean pass also gets a 👍 on the pull request itself.

- core(review): deduplicate diff cache helper, cache empty diffs via != null, validate commit SHAs, and add PR-context JSDoc note (#181 / PR #203)

- api/node/worker: bypass Hyperdrive SQL caching via SELECT clock_timestamp(), fail fast on disconnected Redis via PING_REDIS, coalesce in-flight probes, suppress late rejections, preserve logger requestId on health probe warnings, and add adapter wiring tests + K8s timeoutSeconds docs (#173 / PR #202)

- models/schema: guard non-finite/negative thinkingBudget, exclude o1-mini/o1-preview from reasoning_effort, simplify Zod schema, and consolidate OpenAI tests with real schema parsing (#177 / PR #201)
@devarshishimpi
devarshishimpi force-pushed the fix/followup-prs-201-202-203 branch from 767f692 to a868690 Compare November 29, 2026 22:39

@codra-app-personal codra-app-personal 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.

Codra Review

✅ Nothing to flag. Reviewed 17 files (937 changed lines) and found no issues worth raising.

Note

1 candidate did not survive the evidence and claim gates — see the dashboard for what was dropped and why.

Reviewed commit: a86869055e

ℹ️ About Codra in GitHub

Your team has set up Codra to review pull requests in this repo. Reviews are triggered when you:

  • Open a pull request for review
  • Mark a draft as ready

Every review posts a summary here. A clean pass also gets a 👍 on the pull request itself.

@devarshishimpi
devarshishimpi merged commit ac57c08 into main Nov 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant