fix: skip workspace resolution when client factory is active#630
Merged
phernandez merged 1 commit intomainfrom Feb 27, 2026
Merged
fix: skip workspace resolution when client factory is active#630phernandez merged 1 commit intomainfrom
phernandez merged 1 commit intomainfrom
Conversation
When the cloud MCP server runs in-process, it calls set_client_factory() so that get_client() routes requests through TenantASGITransport. However, get_project_client() was still entering the cloud workspace resolution path for cloud-mode projects, which calls get_cloud_control_plane_client() to hit the production API at /workspaces/. This fails with 401 because the in-process server has no credentials for calling itself externally. Add an early is_factory_mode() check in get_project_client() that short-circuits before workspace resolution. When a factory is set, the transport layer has already resolved workspace and tenant context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Joe P <joe@basicmemory.com>
phernandez
approved these changes
Feb 27, 2026
Member
|
@claude could we also check here instead of this weird factor_mode notion? |
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
1 similar comment
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
phernandez
added a commit
that referenced
this pull request
Feb 28, 2026
Add write_note overwrite guard (#632) to new capabilities, 8 bug fixes (#631, #630, #30, #31, #28, plus schema_validate/Post/frontmatter fixes), and write_note idempotency breaking change to upgrade notes. Bump commit count from 80+ to 90+. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
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
set_client_factory(),get_project_client()was still entering the cloud workspace resolution path for cloud-mode projectsget_cloud_control_plane_client()which hit the production API at/workspaces/, failing with 401 since the in-process server has no credentials to call itself externallyis_factory_mode()check that short-circuits before workspace resolution — the transport layer has already resolved workspace and tenant contextTest plan
test_factory_mode_skips_workspace_resolution— sets up a factory client, patchesresolve_workspace_parameterandget_cloud_control_plane_clientto fail if called, verifies neither is invokedtest_project_context.pytests passread_note,search_notes, andlist_directoryMCP tools in cloud server🤖 Generated with Claude Code