test(gateway): cover normalized OAuth tool contracts - #508
Open
elibosley wants to merge 3 commits into
Open
Conversation
jmagar
force-pushed
the
fix/oauth-tool-contract-normalization
branch
from
September 1, 2026 19:08
b6c1746 to
a476849
Compare
jmagar
marked this pull request as ready for review
September 1, 2026 21:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Protect OAuth tool dispatch from false contract mismatches caused by documentation normalization.
Why This Exists
An unchanged OAuth tool could be rejected as changed before dispatch when discovery normalized its descriptor but the final peer check used raw metadata.
Resolution
Extend the existing subject-scoped execution test to include documentation that requires normalization, plus an exact schema value that must remain unchanged. The production correction is already upstream; this PR adds regression coverage.
Reviewer Considerations
925bd00c) has unrelated missing runtime and gateway exports. Local validation uses the repair revision from fix: repair merged runtime and gateway regressions #507 (63f627b6) with this test patch applied. Those repairs are not duplicated here.Behavior Changes
No production behavior changes. The test now detects inconsistent normalization between discovery and dispatch.
Implementation Summary
Verification
63f627b6) with this patch applied.contract_changed; restoring the upstream implementation passes.rustfmt --edition 2024 --check crates/labby-gateway/src/gateway/manager/tests/code_mode.rs: passed.git diff --check: passed.925bd00c), Cargo tests are blocked by existing missing runtime exports; workspace formatting is blocked by existing syntax errors inapi/router.rs. fix: repair merged runtime and gateway regressions #507 repairs this baseline.cargo test -p labby-gateway --all-features: 1,101 passed, 5 ignored.cargo clippy -p labby-gateway --all-features --all-targets -- -D warningsandcargo fmt --all -- --check: passed.gateway_skills_list_is_restricted_to_route_visible_upstreamsexpectsunknown_upstreamwhile the feature-disabled build correctly returnsfeature_not_compiled. The all-feature run passes that test.Risk
Low; one existing test is extended. Main must receive its separate build repairs before its test suite can run.