Skip to content

fix(backend): include surface flag in OpenAPI stale-contract hint#10294

Closed
kodjima33 wants to merge 1 commit into
mainfrom
issues-improver/10217-openapi-surface-flag-hint
Closed

fix(backend): include surface flag in OpenAPI stale-contract hint#10294
kodjima33 wants to merge 1 commit into
mainfrom
issues-improver/10217-openapi-surface-flag-hint

Conversation

@kodjima33

@kodjima33 kodjima33 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

The --check failure hint in backend/scripts/export_openapi.py now includes the surface-selection flag, so following it verbatim regenerates the correct surface.

Why

From #10217:

Following that command verbatim silently exports the public surface (surface defaults to public) into the app-client file — 53k lines deleted, wrong contract — because surface selection is a separate flag, not inferred from the output path. The correct command is backend/scripts/export_openapi.py --app-client --write.

Evidence: hit while preparing #10215 today; the wrong invocation produced a 17-path public spec in place of the 309-path app-client spec and --check (also without the flag) then validated the wrong surface as 'up to date'.

check_spec had no knowledge of which surface was being checked, so its is stale / does not exist hints always emitted the bare --write <path> command, which defaults to the public surface.

Change

  • check_spec(path, generated, surface='public') now prefixes the correct selector via a new surface_flag() helper: --app-client for app-client, --surface integration-public for integration-public, empty for public (default invocation unchanged).
  • main() passes args.surface into check_spec.
  • Regression test test_stale_hint_includes_surface_flag_for_non_public_surfaces asserts each surface's hint carries its selector and that public stays flag-free.

Verified

  • Exercised the real check_spec code path for all three surfaces plus the does-not-exist branch (via the pinned openapi runner venv): every hint carries the right flag; the public hint is byte-for-byte the previous default.
    • app-client → ... run backend/scripts/export_openapi.py --app-client --write <path>
    • integration-public → ... --surface integration-public --write <path>
    • public → ... export_openapi.py --write <path> (unchanged)
  • tests/unit/test_openapi_contract.py — 15 passed (including the new regression test).
  • black --line-length 120 --skip-string-normalization clean on both files.

Auto-generated from issue feedback by the mini issues-improver. Review before merge.

Review in cubic

The stale/missing-file hint from export_openapi.py's --check told users to
run `export_openapi.py --write <path>`, omitting the surface-selection flag.
Surface is a separate flag (defaults to `public`), not inferred from the
output path, so following the hint verbatim for a non-public surface silently
exports the public surface into the wrong file (e.g. 17-path public spec
overwriting the 309-path app-client spec) and --check then validates the wrong
surface as up to date.

check_spec now takes the surface and prefixes the correct flag
(`--app-client ` / `--surface integration-public `; empty for public) in both
the stale and does-not-exist hints. Regression test asserts each surface's
hint carries its selector.

Verified: exercised check_spec directly for all three surfaces plus the
does-not-exist branch (correct flag in every hint, public unchanged); full
tests/unit/test_openapi_contract.py green (15 passed) via the pinned openapi
runner venv.

fixes #10217
@kodjima33

Copy link
Copy Markdown
Collaborator Author

Closing — opened by an automated bot and left unreviewed. The bot policy has changed: it now tests and merges fixes directly (or reports them), and no longer leaves open PRs for review. If this fix is still wanted, reopen and it'll be landed properly (tested → merged). 🤖

@kodjima33 kodjima33 closed this Jul 22, 2026
@kodjima33
kodjima33 deleted the issues-improver/10217-openapi-surface-flag-hint branch July 22, 2026 19:06
@github-actions

Copy link
Copy Markdown
Contributor

Hey @kodjima33 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to 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.

1 participant