Skip to content

feat(api): add warmup endpoint#768

Open
Komzpa wants to merge 16 commits into
Soju06:mainfrom
Komzpa:revive/pr-506
Open

feat(api): add warmup endpoint#768
Komzpa wants to merge 16 commits into
Soju06:mainfrom
Komzpa:revive/pr-506

Conversation

@Komzpa
Copy link
Copy Markdown
Collaborator

@Komzpa Komzpa commented May 21, 2026

Summary

Revives #506 on a maintainer-owned branch because the original PR head has maintainerCanModify=false.

Credit: original implementation by @huzky-v in #506; this branch rebases and updates that work on current main.

  • Adds /v1/warmup support with warmup request logging, account-scope handling, aggregate exclusions, settings, and OpenSpec coverage.
  • Fixes the Codex needs-work blocker by enforcing and releasing API-key usage reservations before each warmup upstream request, so limited keys cannot generate upstream traffic for free.

Validation

  • uv run pytest tests/integration/test_proxy_warmup.py tests/integration/test_warmup_accounting_exclusions.py -q passed: 9 passed
  • uv run ruff check app/modules/proxy/service.py tests/integration/test_proxy_warmup.py passed
  • uv run ty check app/modules/proxy/service.py app/modules/proxy/api.py tests/integration/test_proxy_warmup.py passed
  • git diff --check passed

OpenSpec

  • add-v1-warmup-endpoint remains included and updated.

Revives #506

@Komzpa Komzpa added the db migration PR changes Alembic database migrations; maintainer must coordinate merge order label May 21, 2026
@Komzpa Komzpa mentioned this pull request May 21, 2026
Copy link
Copy Markdown

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

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: 7b67bcf729

ℹ️ 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 app/modules/proxy/service.py
Comment thread app/modules/proxy/service.py Outdated
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented May 21, 2026

@codex review

Copy link
Copy Markdown

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

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: 87b9b54db0

ℹ️ 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 app/modules/proxy/service.py Outdated
@Soju06 Soju06 added 🤖 codex: needs work [@codex review] raised an issue and removed 🤖 codex: needs work [@codex review] raised an issue labels May 21, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented May 21, 2026

@codex review

Copy link
Copy Markdown

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

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: d86131981a

ℹ️ 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 app/modules/proxy/service.py Outdated
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06 Soju06 removed the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Komzpa
Copy link
Copy Markdown
Collaborator Author

Komzpa commented May 21, 2026

@codex review

Copy link
Copy Markdown

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

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: 76acdbccd5

ℹ️ 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 app/modules/proxy/service.py Outdated
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06 Soju06 removed the 🤖 codex: needs work [@codex review] raised an issue label May 21, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented May 21, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

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

@Soju06 Soju06 added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: ok [@codex review] says no issues found. labels May 21, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented May 22, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

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

@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented May 24, 2026

@codex review

Copy link
Copy Markdown

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

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: 81294c20bb

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

@Komzpa
Copy link
Copy Markdown
Collaborator Author

Komzpa commented May 24, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

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

@Komzpa Komzpa added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: needs work [@codex review] raised an issue labels May 24, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented Jun 1, 2026

Hermes owner-review blocker found after the clean Codex/CI pass.

The OpenSpec delta promises that the new normal warmup model is operator-editable from the dashboard settings UI:

  • openspec/changes/add-v1-warmup-endpoint/specs/proxy-warmup/spec.md:65-74 says warmup_model is readable/updatable through the existing settings APIs and dashboard settings UI, and that updates affect subsequent warmup requests.

The implementation only adds schema/payload preservation, not a UI control:

  • frontend/src/features/settings/schemas.ts:16,36 accepts warmupModel.
  • frontend/src/features/settings/payload.ts:14 preserves the current value during unrelated saves.
  • But the settings components only expose the legacy limit warm-up model/prompt fields (frontend/src/features/settings/components/routing-settings.tsx:30-52,172-216) and there is no dashboard input/save path for settings.warmupModel itself.

So an operator cannot perform the spec-required UI update; changing the normal /v1/warmup model currently requires API/direct backend access. Please either add the dashboard UI + tests for editing warmupModel, or narrow the OpenSpec requirement if UI editability is intentionally out of scope.

One adjacent spec/code mismatch to settle while touching this: the delta says each upstream warmup uses the configured warmup_model (spec.md:54-59), but the service replaces it with an API key's enforced_model when present (app/modules/proxy/service.py:2856-2859). If enforced-model precedence is intended, please make that explicit in OpenSpec and add a regression test; otherwise use the configured model with the appropriate access check.

@Soju06 Soju06 added the hermes: needs-followup Hermes left a blocker/comment that needs follow-up observation label Jun 1, 2026
@Komzpa Komzpa removed hermes: needs-followup Hermes left a blocker/comment that needs follow-up observation 🤖 codex: ok [@codex review] says no issues found. labels Jun 1, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented Jun 1, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

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

@Soju06 Soju06 added the 🤖 codex: ok [@codex review] says no issues found. label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: ok [@codex review] says no issues found. db migration PR changes Alembic database migrations; maintainer must coordinate merge order

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants