Send diagnostic view state as model context to MCP host#30
Open
Send diagnostic view state as model context to MCP host#30
Conversation
Sends the current view (home, analyzing, or report) as model context so the studio host always knows what diagnostic the user is looking at. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
site-diagnostics | 3e58afe | Apr 20 2026, 09:22 PM |
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
web/hooks/use-model-context.ts— a debounced hook that pushes the current diagnostic state to the MCP host viaapp.updateModelContextDiagnosticsPageso the host always knows whether the user is on the home screen, analyzing a URL, or viewing a specific report (including title, URL, health score, and truncated report content)Test Plan
Summary by cubic
Send the Diagnostics view state to the MCP host as model context so the host always knows what the user is looking at. Adds a debounced hook and wires it into
DiagnosticsPage.web/hooks/use-model-context.ts— debounced (500ms) updates viaapp.updateModelContext.DiagnosticsPage; updates on view/history changes and clears context on unmount.Written for commit 3e58afe. Summary will update on new commits.