Skip to content

Fix stale resource content in Resources panel#1267

Open
nicbarrett wants to merge 1 commit intomodelcontextprotocol:mainfrom
nicbarrett:nic/codex/resource-pane-stale-content
Open

Fix stale resource content in Resources panel#1267
nicbarrett wants to merge 1 commit intomodelcontextprotocol:mainfrom
nicbarrett:nic/codex/resource-pane-stale-content

Conversation

@nicbarrett
Copy link
Copy Markdown

Summary

  • render resource details from the selected resource URI instead of a single shared content buffer
  • allow explicit resource refreshes to bypass the client cache
  • add a regression test for switching back to an already-cached resource

Problem

The Resources panel could show stale content from a previously read resource when switching back to a resource that had already been cached. The selected row and heading updated, but the detail pane could continue showing a different resource's payload.

Root cause

  • the Resources tab rendered a single global resourceContent string instead of content derived from selectedResource.uri
  • readResource() returned early for cached resources, so selecting an already-read resource did not repopulate the visible pane
  • the Refresh button also hit the same cache short-circuit

Fix

  • derive displayed resource content from resourceContentMap[selectedResource.uri]
  • add a force flag to readResource()
  • use the force path from the Resources panel Refresh button

Validation

  • npm test --workspace=client -- --runInBand App.resources.test.tsx ResourcesTab.test.tsx

Closes #1266.

@nicbarrett nicbarrett force-pushed the nic/codex/resource-pane-stale-content branch 2 times, most recently from 1e26f3f to da383be Compare April 30, 2026 18:45
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.

Resources panel can show stale content for the wrong selected resource

1 participant