Skip to content

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

Closed
kodjima33 wants to merge 1 commit into
mainfrom
watchdog/issue-10217-openapi-surface-hint
Closed

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

Conversation

@kodjima33

@kodjima33 kodjima33 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #10217

Bug

backend/scripts/export_openapi.py's contract check prints a fix-it hint on a stale or missing spec:

... is stale; run backend/scripts/export_openapi.py --write <path>

The surface (public / app-client / integration-public) is selected by a separate flag that defaults to public and is not inferred from the output path. So following the hint verbatim for the app-client or integration-public spec regenerates the public surface and overwrites the wrong contract — the reporter saw a 17-path public spec written over the 309-path app-client spec (~53k lines deleted) — and a subsequent --check (also missing the flag) then validated the wrong surface as "up to date".

Fix

check_spec now receives the surface and prepends the selecting flag to both the stale and does-not-exist hints via a small surface_flag() helper:

  • app-client--app-client --write <path>
  • integration-public--surface integration-public --write <path>
  • public → unchanged (--write <path>)

The main() --check call passes args.surface through. No behavior change for the public surface; existing callers/test remain valid.

Verification

Exercised the real check_spec/surface_flag functions from source over a temp spec for all three surfaces plus the missing-file path — each hint now names the flag that actually regenerates that surface. Added test_check_spec_hint_includes_surface_flag as the regression test (extends tests/unit/test_openapi_contract.py). Backend Python env is not installable in the watchdog sandbox, so the full pytest suite runs in CI.

🤖 automated by hourly watchdog; opened for review, not merged.

Review in cubic

…0217)

The stale/missing hints printed by export_openapi.py's contract check told
users to run `export_openapi.py --write <path>`, omitting the surface flag.
Surface selection is a separate flag (defaults to `public`), not inferred
from the output path — so following the hint verbatim for the app-client or
integration-public spec silently regenerated the public surface and
overwrote the wrong contract (53k-line delta observed on the app-client
spec), and `--check` then validated the wrong surface as up to date.

check_spec now takes the surface and prepends the selecting flag
(`--app-client ` / `--surface integration-public `; nothing for public) to
both hints, matching the command that actually regenerates that surface.

Failure-Class: none

Verification: exercised the real check_spec/surface_flag from source over a
tmp spec for all three surfaces + missing-file path — app-client emits
`--app-client --write`, integration-public emits `--surface integration-public --write`,
public stays `--write`. Added test_check_spec_hint_includes_surface_flag.
@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 watchdog/issue-10217-openapi-surface-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.

export_openapi.py stale-contract error message omits the required --app-client flag

1 participant