Skip to content

fix: deployment boot smoke fails with 500 due to missing production env vars - #110

Merged
BigSimmo merged 13 commits into
mainfrom
codex/RAG_FIX
Jun 30, 2026
Merged

fix: deployment boot smoke fails with 500 due to missing production env vars#110
BigSimmo merged 13 commits into
mainfrom
codex/RAG_FIX

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jun 30, 2026

Copy link
Copy Markdown
Owner

check:deployment-readiness was consistently timing out with "Unexpected status: 500" because instrumentation.ts's register() hook calls requireServerEnv() + requireOpenAIEnv() at next start, which throw when SUPABASE_SERVICE_ROLE_KEY and OPENAI_API_KEY are absent — causing Next.js to mark the server unhealthy and 500 every route including the trivial /api/local-project-id probe.

Summary

  • scripts/deployment-boot-smoke.mjs — pass placeholder fallbacks for SUPABASE_SERVICE_ROLE_KEY and OPENAI_API_KEY in the spawned server's env when real secrets aren't present. The smoke target (/api/local-project-id) uses neither; routes that do will still error if exercised. Real secrets are used when available.
  • scripts/deployment-boot-smoke.mjs — fix log cleanup ordering: rmSync was running inside the finally block before dumpLogTail could read the file. Moved cleanup out of finally into separate success/failure paths so server stderr is visible on future failures.

Verification

  • npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed

Clinical Governance Preflight

Not applicable — CI tooling only, no clinical workflow or data path affected.

Notes

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:0eb2fbd4db

ℹ️ 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.github/workflows/ci.yml
Comment threadscripts/check-document-label-coverage.ts Outdated
Comment threadsrc/app/api/search/interaction/route.ts
Comment threadsrc/lib/rag.ts Outdated
Comment threadscripts/eval-quality.ts Outdated
Comment threadsrc/components/DocumentViewer.tsx Outdated
Comment threadsrc/lib/document-organization.ts Outdated
CopilotAI changed the title refactor: component extraction polish and luxury black-first color redesignfix: deployment boot smoke fails with 500 due to missing production env varsJun 30, 2026

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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

confidence: "unsupported",
citations: [],
sources: [],
scope: scope ? { ...scope,queryMode: body.queryMode} : undefined,
sourceGovernanceWarnings: warnings,

P2 Badge Show source-governance refusals in the dashboard

When a dangerous source-governance warning triggers this refusal, the streamed final payload is confidence: "unsupported" with empty sources and no relevance/smartPanel context. The dashboard's answerPayloadIsUsable rejects unsupported answers unless one of those context fields is present, so users get the generic no-usable-results fallback instead of the intended safety refusal and governance warning.

ℹ️ 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 threadsrc/lib/reindex-pipeline.ts
Comment threadscripts/backfill-source-metadata.ts
Comment threadsrc/components/clinical-dashboard/DocumentManagerPanel.tsx
Comment threadsrc/lib/answer-render-policy.ts
@BigSimmo
BigSimmo enabled auto-merge June 30, 2026 16:33
@BigSimmo
BigSimmo merged commit f5eb4cd into mainJun 30, 2026
6 checks passed
BigSimmo pushed a commit that referenced this pull request Jul 29, 2026
Resolves the `docs/outstanding-issues.md` conflict. Two independent causes:
1. Rows #98#105 diverged. `main` carries the newer text (PR #1377 landed
"Done 2026-07-29" outcomes and rewrote several summaries); this branch
carried the pre-#1377 wording. Took `main`'s rows wholesale — the branch
made no edits to that range, it simply forked before them.
2. `#108`/`#109` were allocated twice. `main` used them for the verified-landed
branch deletions and the shallow-clone finding; this branch had used the same
two ids for the design-system token manifest and the `ui-overlap` flake. The
`issues:next-id` marker has no concurrency protection, which is exactly the
failure the branch's own PR notes predicted. Renumbered this branch's two rows
to #110/#111 and bumped the marker to 112. No content was dropped from either
side; all 111 rows are unique.
Also records #111 as done, since this branch is what fixes it: the ui-overlap
inset measurement now retries inside `toPass` with the 2px symmetry tolerance
and the assertions unchanged. Leaving it open with a "Next: apply the retry
shape" action would have re-queued work this PR already did.
BigSimmo added a commit that referenced this pull request Jul 29, 2026
 (#1391)
Follow-ups to #1375 (Clinical Sky design system), which merged before these landed.
`text-4xs` was dead on main. #1375 retired the `--text-4xs` token, so Tailwind
emits no such rule and every remaining `text-4xs` class was a silent no-op with
the text falling back to inherited size. Two files carrying it landed from main
while #1375 was in flight and were dead on arrival. Repointed to `text-3xs`, the
10px floor, and guarded: the design-token contract now fails if any tracked file
under `src/` references the retired class outside a comment. Mockups are
deliberately not exempt — a dead utility breaks a mockup exactly as it breaks
production.
Six hydration races fixed at the source. In this app visible never implies
interactive: the server-rendered tree paints before React owns it, so a single
un-retried action asserted once is a coin flip under load. Every fix retries the
action together with the effect it should produce, so a swallowed first attempt
retries while a genuine regression still fails.
Both retries added to ui-smoke are idempotent, which review caught and which
matters more than it looks. `toPass` schedules another attempt whenever the
inner assertion's own deadline expires — which can happen after the click
already landed. Without a guard, `openGuide` clicked a Settings trigger the
modal was already covering, and the mode-menu retry clicked a TOGGLE a second
time, closing a menu that had just opened and oscillating until the budget ran
out. The mobile branch needed a second guard: a swallowed Settings click leaves
the phone menu open, so re-running `openMobileClinicalGuideMenu` would toggle it
shut and then fail to find Settings inside it — meaning the <768px branch could
not recover on retry at all.
The ui-overlap phone-inset measurement now retries inside `toPass` with the 2px
symmetry tolerance and the assertions byte-for-byte unchanged, so a genuinely
asymmetric header still fails once the retry budget is spent.
Documentation records that the intermediate font weights on the variable face
are deliberate rather than drift, and that redefining Tailwind's own leading
names silently retunes every existing call site.
Also resolves an `issues:next-id` double-allocation: #108/#109 were claimed
concurrently by two branches, so this branch's two rows are renumbered #110/#111
and the marker moved to 112. #111 is archived rather than left open, since this
change is what closes it.
RAG impact: no retrieval behaviour change — test robustness, two mockup class
names, and docs only; nothing under `src/lib/rag/**`, clinical-search,
ranking-config, the eval harness or the golden fixture is touched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvU8z73P6TXUXoYBqN5K1P
BigSimmo added a commit that referenced this pull request Jul 30, 2026
…-30 re-sync) and capture #131 (five undefined CSS custom properties)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto 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

@BigSimmo