Repository navigation
fix(studio): stop a compatibility round trip per request - #2312
Merged
Merged
Conversation
peppescg
approved these changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. Reusing the runtime's cached negotiation is the right fix, and dropping the plan pre-flight in favour of the SDK's own unsupported_feature gate removes a duplicate check.
Nits:
apps/server/src/mecatl/chat.ts:124: the default accessor throwsRuntimeNotReadyError. If a future caller forgets to wire it,detail()quietly returns 503 for every session, and no server test goes throughcreateAppwith a runtime toGET /api/v1/sessions/{id}. One app-level test (createApp({ runtime: fakeRuntime({ compatibility: () => ..., client: ... }) })) checking thatcapabilities.manualCompactioncomes fromruntime.compatibility()would pin it; making the parameter required in production code would also work.apps/server/src/mecatl/runtime.ts:197:MecatlRuntime.compatibility()is new and has no test inruntime.test.ts. One case covering "throws before negotiation, returns the renegotiated value after a reconnect" would pin the staleness behaviour this PR now relies on.apps/server/src/mecatl/chat.test.ts:720(and:640): theserver.compatibilitymocks no longer affect anything; drop them. "gates plan control on the public SDK feature" (:630) could be renamed, since the gate is now the SDK's error.
Session detail now reads the runtime's cached negotiation, and plan ask resolution relies on the SDK's own ExactPlanAskControl check (unsupported_feature) instead of a pre-flight compatibility RPC. Document the storageMigration and bash capability fields. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
kantord
force-pushed
the
studio-followups/02-compat-cache
branch
from
October 15, 2026 09:25
fa0ba4d to
32eae43
Compare
Merged
2 tasks
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
Session detail and plan ask resolution each issued a
server.compatibility()RPC per request.Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 2 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
MecatlRuntimeexposes its cached negotiation (compatibility());detail()reads it instead of making an RPC.resolvePlanAskpre-flight is removed. The SDK already checksExactPlanAskControlfrom its cached features and throwsunsupported_feature, which the service already maps to "unavailable".copyCapabilitiesexplain thatstorageMigrationis a constantfalsekept for BFF response-shape stability (a reserved proto field) and thatbashis an alias ofshell.createMecatlChatService(client, compatibility?): the accessor is optional with a default that throwsRuntimeNotReadyError, so about 25 existing test call sites did not change.app.tsalready mapsRuntimeNotReadyErrorto 503.Behavior changes
None observable. Plan "unavailable" now surfaces via
unsupported_featureinstead of a pre-flight.Verification
Biome, typecheck, the full Studio test suite and
pnpm generated:checkpass on this branch, run on the assembled stack. The full Playwright suite passes on the stack tip (122 passed, 30 skipped, 0 failed, includingchat-approvalagainst a realmecatedbuild). With the oldchat.tsrestored, six tests fail, including the new "reads detail capabilities from the cached negotiation" test.Not included
Removing
storageMigrationorbashfrom the schema.Fully or partially written by an AI agent.
🤖 Generated with Claude Code