Conversation
…ents The managed OAuth credential is created with the suffix '-oauth' (e.g. 'my-gateway-oauth') but was being looked up with '-agent-oauth' in schema-mapper.ts and displayed with '-agent-oauth' in AddGatewayScreen. This mismatch caused the credential lookup to fail silently, resulting in an empty provider_name in the generated @requires_access_token decorator. The agent runtime then crashed with: ParamValidationError: Invalid length for parameter resourceCredentialProviderName, value: 0, valid min length: 1
138cee9 to
e6cd895
Compare
Replace inline credential name construction with a shared function in credential-utils.ts. All three consumers (GatewayPrimitive, schema-mapper, AddGatewayScreen) now use the same function, preventing future naming drift. Add regression test for the shared function.
tejaskash
approved these changes
Mar 13, 2026
Contributor
tejaskash
left a comment
There was a problem hiding this comment.
Looks good — clean bug fix, correct root cause, shared utility prevents future drift. Ship it.
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.
Description
Fixed a credential name mismatch that caused agent runtimes to crash when connecting to gateways with CUSTOM_JWT auth.
When a gateway with CUSTOM_JWT auth is created, the CLI creates a managed OAuth credential with the suffix
-oauth(e.g.my-gateway-oauth). However, when generating the MCP client code for the agent,schema-mapper.tslooked up the credential using the suffix-agent-oauth(e.g.my-gateway-agent-oauth). This lookup failed silently, resulting in an emptyprovider_namein the generated@requires_access_tokendecorator.At runtime, the agent crashed with:
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid length for parameter resourceCredentialProviderName, value: 0, valid min length: 1
The fix aligns the lookup suffix in
schema-mapper.tsand the UI preview inAddGatewayScreen.tsxto match the creation suffix (-oauth). Added a regression test to prevent future naming drift.Related Issue
Closes #544
Documentation PR
N/A
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.