Skip to content

fix(cache): invalidate stdio metadata on env mode changes - #683

Closed
quifox wants to merge 1 commit into
nicobailon:mainfrom
quifox:fix/stdio-env-cache-identity
Closed

quifox wants to merge 1 commit into
nicobailon:mainfrom
quifox:fix/stdio-env-cache-identity

Conversation

@quifox

@quifox quifox commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Changing inheritEnv or literalEnv can change a stdio server's tool catalog. The metadata cache previously treated the old catalog as valid, so lazy startup could advertise stale tools.

Include the effective stdio environment modes in the cache identity and hash literal env values as literals. URL and Unix socket cache identities remain unchanged.

Validation

  • Regression tests cover stale direct-tool registration, Agent Plugin literal env, and historical URL/socket cache hashes.
  • 294 tests passed across eight relevant Vitest suites.
  • npm run typecheck passed.

@greptile-apps

greptile-apps Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes how tool metadata cache validity is computed.

The PR appears safe to merge; no issue caused by the changed code was identified.

Summary

The PR adds effective stdio environment modes to the metadata cache identity and hashes literal environment values without host interpolation.

  • Changing inheritEnv or literalEnv now invalidates cached stdio metadata.
  • URL and socket cache identities remain unchanged, with regression tests covering both cases.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Server definition] --> B{Stdio command?}
  B -->|Yes| C[Hash effective environment modes and env values]
  B -->|No| D[Preserve URL or socket identity]
  C --> E[Compare with cached hash]
  D --> E
  E --> F{Match and fresh?}
  F -->|Yes| G[Use cached metadata]
  F -->|No| H[Refresh metadata on connection]
Loading

Reviews (1) · Last reviewed commit: "fix(cache): invalidate stdio metadata on..."

@nicobailon

Copy link
Copy Markdown
Owner

Thanks @kojizada490-wq — this fix landed in #687 on current main, preserving your implementation and adding changelog credit for your contribution.

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.

2 participants