Skip to content

fix(api-server): CORS expose headers + Cache-Control no-store (salvage of #3707/#3712 by @aydnOktay) - #62759

Open
Bartok9 wants to merge 2 commits into
NousResearch:mainfrom
Bartok9:salvage/3707-3712-api-headers
Open

fix(api-server): CORS expose headers + Cache-Control no-store (salvage of #3707/#3712 by @aydnOktay)#62759
Bartok9 wants to merge 2 commits into
NousResearch:mainfrom
Bartok9:salvage/3707-3712-api-headers

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Salvages the API-server header portions of #3707 and #3712 by @aydnOktay onto current main.

What the original PRs fixed

  • Browser clients could not read Location / X-Request-Id / Idempotency-Key without expose-headers
  • Responses lacked a default Cache-Control: no-store from security middleware

Why they needed salvage

Original PRs bundled unrelated skill_commands changes and went stale.

Changes from original

  • API server only (no skill_commands drive-bys)
  • Unit tests for both header behaviors

Testing

python3 -m pytest tests/gateway/test_api_server.py::TestApiServerCorsAndCacheHeaders -q

Full credit to @aydnOktay.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused salvage. Current main's CORS defaults contain only request-side allow headers at gateway/platforms/api_server.py:546-549, and security_headers_middleware has no Cache-Control default at gateway/platforms/api_server.py:698-703. The proposed changes target those live middleware paths, which are installed by the API server at gateway/platforms/api_server.py:4766-4767, and the added tests exercise them through an aiohttp application.

Automated hermes-sweeper review.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels Jul 11, 2026
@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 11, 2026
@Bartok9

Bartok9 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (was ~7k commits behind; mergeable cleaner).

Review note (sweeper keep_open / high): the change remains the same focused salvage of #3707/#3712:

  • Access-Control-Expose-Headers includes Location, X-Request-Id, Idempotency-Key on CORS defaults
  • security_headers_middleware defaults Cache-Control: no-store when unset
  • TestApiServerCorsAndCacheHeaders covers both through the aiohttp app

Local: pytest tests/gateway/test_api_server.py::TestApiServerCorsAndCacheHeaders → 2 passed.

Not merging from author side — ready for re-review when CI is green.

@Bartok9
Bartok9 force-pushed the salvage/3707-3712-api-headers branch from d8f8c9d to b7a087d Compare July 17, 2026 17:06
@Bartok9

Bartok9 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebuilt onto latest main via patch re-apply (force-push). Please re-run CI.

— Bartok9 public PR hygiene 2026-08-01

@Bartok9
Bartok9 force-pushed the salvage/3707-3712-api-headers branch from b7a087d to 7ed93e9 Compare August 1, 2026 17:37
…tok9

Per-PR attribution so check-attribution passes on this branch (Teknium).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants