Repository navigation
Chore: dependency, API updates. - #11
Merged
Merged
Conversation
Chrome's Prompt API allows at most one responseConstraint prompt per session; a second always rejects with kErrorUnknown, well below any context limit. clone() inherits the state and append() doesn't help. This broke every tool loop at iteration 2. - runToolLoop takes a createIterationSession(history) factory and runs each iteration on a fresh session, replaying history via initialPrompts - promptSessionConstrainedWithRetry retries on a new session instead of re-prompting the exhausted one (same latent bug on the timeout path) - slimToolResult: chunk.text is an array, so slice() capped chunk count instead of characters and excerpts were never truncated
There was a problem hiding this comment.
Pull request overview
This PR updates CDN/imported dependencies and adapts the app’s WebMCP + Prompt API integration to Chrome’s “one constrained prompt per session” limitation by rebuilding sessions per iteration and replaying conversation history.
Changes:
- Bumps browser-imported libraries (React, Marked, @mcp-b/*) and dev tooling (eslint/prettier), plus adds a dependency check script.
- Introduces
getModelContext()and updates WebMCP detection/registration paths; updates iframe permissions policy delegation for tools. - Refactors agent/tool loops to create a fresh tool-aware Prompt API session per iteration and on retry, replaying prior history.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| public/index.html | Updates import-map/CDN versions for React/Marked/@MCP-B and relay embed script. |
| public/app/util/platform.js | Adds getModelContext() and uses it for WebMCP detection. |
| public/app/index.js | Switches platform status import to ./util/platform.js. |
| public/app/bridge/tool-registry.js | Uses getModelContext() and awaits local tool registration. |
| public/app/bridge/iframe-bridge.js | Delegates "tools" permission policy to the iframe for local dev cross-origin. |
| public/app/agents/tool-loop.js | Changes tool loop to accept a session factory; manages per-iteration session lifecycle + history replay. |
| public/app/agents/prompt-api.js | Extends tool session creation to accept replayable history; retries constrained prompts on a fresh session. |
| public/app/agents/agent-loop.js | Updates agent loop to pass a per-iteration session factory to runToolLoop; improves excerpt truncation logic. |
| package.json | Adds dep:check script; bumps eslint/prettier versions. |
| package-lock.json | Lockfile updates consistent with dependency/tooling changes. |
| .gitignore | Ignores .claude/settings*.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Updates CDN/imported dependencies and adapts the app’s WebMCP + Prompt API integration to Chrome’s “one constrained prompt per session” limitation by rebuilding sessions per iteration and replaying conversation history.
Changes:
getModelContext()and updates WebMCP detection/registration paths; updates iframe permissions policy delegation for tools.