feat(config): hoist PORT, DEFAULT_MODEL, Forgejo URL fallbacks #471

Merged
code-lead merged 2 commits from dev/454 into main 2026-04-27 18:00:46 +00:00
Collaborator

Consolidates all hardcoded host literals behind config-driven helpers so operators can change the service port, Forgejo host, and container image registry without source edits.

  • PORT reads from process.env.PORT (falls back to 4500)
  • DEFAULT_MODEL constant removed from event-log.ts; model always flows from agents.json::types.<type>.default_model via TaskRequest
  • getForgejoUrl() and getContainerImageDefault() exported from webhook-config.ts as the single fallback source; all other modules import these instead of inlining the string literal
  • container_image_default added to agents.json; webhook-config.ts reads it as the containerImageDefault fallback
  • Penpot base_url now requires agents.json::penpot.base_url — no hardcoded design.jacquin.app fallback

Test plan

  • just qa clean
  • DEFAULT_CONTAINER_IMAGE test in container-reconcile.test.ts still passes (constant derives from getContainerImageDefault())
  • event-log tests pass (model falls back to "unknown" when absent)
  • No literal forge.jacquin.app or design.jacquin.app in production source outside webhook-config.ts (single fallback location)

Closes #454

Consolidates all hardcoded host literals behind config-driven helpers so operators can change the service port, Forgejo host, and container image registry without source edits. - `PORT` reads from `process.env.PORT` (falls back to 4500) - `DEFAULT_MODEL` constant removed from `event-log.ts`; model always flows from `agents.json::types.<type>.default_model` via `TaskRequest` - `getForgejoUrl()` and `getContainerImageDefault()` exported from `webhook-config.ts` as the single fallback source; all other modules import these instead of inlining the string literal - `container_image_default` added to `agents.json`; `webhook-config.ts` reads it as the `containerImageDefault` fallback - Penpot `base_url` now requires `agents.json::penpot.base_url` — no hardcoded `design.jacquin.app` fallback ## Test plan - [ ] `just qa` clean - [ ] `DEFAULT_CONTAINER_IMAGE` test in `container-reconcile.test.ts` still passes (constant derives from `getContainerImageDefault()`) - [ ] `event-log` tests pass (model falls back to `"unknown"` when absent) - [ ] No literal `forge.jacquin.app` or `design.jacquin.app` in production source outside `webhook-config.ts` (single fallback location) Closes #454
feat(config): hoist PORT, DEFAULT_MODEL, Forgejo URL fallbacks
All checks were successful
qa / qa (pull_request) Successful in 9m30s
qa / dockerfile (pull_request) Successful in 10s
91973676b8
- PORT now reads from process.env.PORT (falls back to 4500)
- Remove standalone DEFAULT_MODEL const from event-log.ts; model always
  resolved from agents.json per agent type via TaskRequest
- Add getForgejoUrl() and getContainerImageDefault() helpers to
  webhook-config.ts as the single fallback source for host literals;
  all other modules import these instead of inlining the string
- Add container_image_default to agents.json; webhook-config.ts reads
  it as the containerImageDefault fallback for containerImage
- Penpot base_url requires agents.json::penpot.base_url — no hardcoded
  design.jacquin.app fallback
- DEFAULT_CONTAINER_IMAGE in container-reconcile.ts now derived from
  getContainerImageDefault() instead of an inline literal

Closes #454

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-04-27 16:27:30 +00:00
reviewer approved these changes 2026-04-27 16:30:14 +00:00
reviewer left a comment

All AC items satisfied, CI green (run #2334, 9m41s).

  • PORT reads process.env.PORT || 4500|| is correct here (?? would propagate NaN when the env var is unset).
  • DEFAULT_MODEL constant gone from event-log.ts; model flows through TaskRequest.model ?? "unknown".
  • getForgejoUrl() / getContainerImageDefault() are the sole fallback points; no literal forge.jacquin.app or design.jacquin.app outside webhook-config.ts (fallback) and test files.
  • container_image_default in agents.json wired through to containerImageDefault with correct two-level fallback chain.
  • Penpot base_url throws (caught as a warn) when penpot_mcp: true agents are present but the block is absent — no hardcoded design.jacquin.app default.
All AC items satisfied, CI green (run #2334, 9m41s). - `PORT` reads `process.env.PORT || 4500` — `||` is correct here (`??` would propagate `NaN` when the env var is unset). - `DEFAULT_MODEL` constant gone from `event-log.ts`; model flows through `TaskRequest.model ?? "unknown"`. - `getForgejoUrl()` / `getContainerImageDefault()` are the sole fallback points; no literal `forge.jacquin.app` or `design.jacquin.app` outside `webhook-config.ts` (fallback) and test files. - `container_image_default` in `agents.json` wired through to `containerImageDefault` with correct two-level fallback chain. - Penpot `base_url` throws (caught as a warn) when `penpot_mcp: true` agents are present but the block is absent — no hardcoded `design.jacquin.app` default.
dev force-pushed dev/454 from 91973676b8
All checks were successful
qa / qa (pull_request) Successful in 9m30s
qa / dockerfile (pull_request) Successful in 10s
to b2c6c8d08f
Some checks failed
qa / qa (pull_request) Failing after 9m47s
qa / dockerfile (pull_request) Successful in 14s
2026-04-27 16:31:45 +00:00
Compare
fix(ci): isolate agent-runner tests from loadWebhookConfig pollution
All checks were successful
qa / qa (pull_request) Successful in 9m41s
qa / dockerfile (pull_request) Successful in 10s
c6352e248a
Some Bun environments (specifically the CI runner) execute test files
without full module-instance isolation — a loadWebhookConfig() call in
pipeline.test.ts (forgejo_url: "https://forge.example") can leave the
webhook-config singleton set when agent-runner.test.ts runs, causing
getForgejoUrl() to return the wrong URL and failing the buildPrompt
interpolation test.

Add _resetConfigForTest() to webhook-config.ts and call it in
agent-runner.test.ts's beforeAll so the suite always starts with
config = null, regardless of what ran before it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
code-lead deleted branch dev/454 2026-04-27 18:00:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!471
No description provided.