Skip to content

feat: round out phase 5 of chat migration. - #151

Merged
knightedcodemonkey merged 2 commits into
chatfrom
chat-phase-5
Sep 7, 2026
Merged

feat: round out phase 5 of chat migration.#151
knightedcodemonkey merged 2 commits into
chatfrom
chat-phase-5

Conversation

@knightedcodemonkey

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 7, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The streaming sanitizer can still surface partial tool-call payloads mid-stream and the new docs contain broken relative links within the docs/ folder.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Rounds out phase 5 of the chat migration by polishing the AI chat UX, tightening chat response handling, splitting Playwright coverage into a dedicated chat spec, and updating documentation to reflect the OpenRouter BYOK flow separate from GitHub PAT.

Changes:

  • Improve AI chat “pending” status presentation (shimmer + reduced-motion support) and add pending-state accessibility metadata.
  • Sanitize assistant streaming/fallback content and enforce non-empty assistant output or tool calls.
  • Split AI chat Playwright coverage into playwright/chat/ai-chat.spec.ts and update docs/README messaging for OpenRouter BYOK.
File summaries
File Description
src/styles/ai-controls.css Adds a shimmer animation for pending chat status text with reduced-motion fallback.
src/modules/chat/request-runner.js Sanitizes assistant content/tool syntax and hardens stream/fallback result validation.
src/modules/chat/model-picker.js Refactors model catalog loading to async/await and centralizes cleanup of pending promise state.
src/modules/chat/drawer.js Tracks pending state in DOM dataset and sets aria-busy while requests are in-flight.
src/index.html Updates PAT guidance to clarify OpenRouter key is used for chat separately.
README.md Adds OpenRouter BYOK doc link and clarifies PAT vs chat key responsibilities.
playwright/github-byot-ai.spec.ts Removes chat-focused tests, keeping PR/BYOT coverage in this suite.
playwright/chat/ai-chat.spec.ts New dedicated AI chat Playwright suite covering BYOK gating, streaming/fallback, and apply/undo flows.
docs/openrouter-migration-plan.md Updates implementation status to reflect phase completion and new test/doc locations.
docs/openrouter-byok.md Introduces OpenRouter BYOK setup guide for chat + model catalog loading.
docs/localstorage-state.md Documents the new OpenRouter key localStorage entry.
docs/byot.md Updates BYOT doc to reflect PAT no longer powers chat; links to OpenRouter BYOK guide.
docs/ai-chat-context-and-payload-strategy.md Updates the referenced Playwright spec path for chat behavior coverage.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +11 to +19
const sanitizeAssistantContent = value => {
if (typeof value !== 'string' || !value) {
return ''
}

return value
.replace(/<\|tool_call_start\|>[\s\S]*?<\|tool_call_end\|>/g, '')
.replace(/<\|tool_call_start\|>|<\|tool_call_end\|>/g, '')
}
Comment thread docs/byot.md Outdated
Comment thread docs/openrouter-byok.md Outdated
@knightedcodemonkey
knightedcodemonkey merged commit d72c84e into chat Sep 7, 2026
5 checks passed
@knightedcodemonkey
knightedcodemonkey deleted the chat-phase-5 branch September 7, 2026 17:57
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