[MM-70581] Use the loaded origin for Agents API requests - #1025
Conversation
Co-authored-by: mattermost-code <matty-code@mattermost.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
This PR meets the approval criteria (Bugbot and Security Agent were not present after the first poll; no policy required human review), but GitHub cannot accept an approval on a pull request authored by this same app. Reviewers were not assigned; human review is needed for merge.
Sent by Cursor Approval Agent: Pull Request Approver
🤖 LLM Evaluation ResultsOpenAI
❌ Failed EvaluationsShow 7 failuresOPENAI1. TestReactEval/[openai]_react_cat_message
2. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
3. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
4. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
5. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
6. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
7. TestDirectMessageConversations/[openai]_bot_dm_tool_introspection
Anthropic
❌ Failed EvaluationsShow 7 failuresANTHROPIC1. TestReactEval/[anthropic]_react_cat_message
2. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
3. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
4. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
5. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
6. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
7. TestDirectMessageConversations/[anthropic]_bot_dm_tool_introspection
This comment was automatically generated by the eval CI pipeline. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughWalkthroughPlugin initialization now sets the client site URL from the browser origin and optional basename. Tests configure a separate site URL and verify that initialization uses the browser-derived URL. ChangesSite URL initialization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Agents API requests now use the browser-loaded origin and optional Mattermost basename, allowing alternate hostnames, SSH tunnels, and subpath installations to reach the correct API endpoint. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Plugin Spinwick PR #1025 🎉 Test server created! Access here: https://agents-pr-1025-o5ahy.test.mattermost.cloud
Installation ID: Credentials: Posted securely in this Mattermost channel - Look for PR #1025 |
|
@crspeller — friendly nudge: this PR has been waiting on your review for a couple of days and CodeRabbit has already signed off. Could you take a look when you get a chance? 🙏 |


Summary
Use the browser-loaded origin plus Mattermost basename for Agents webapp API requests instead of the configured SiteURL. This keeps SSH tunnels and alternate hostnames same-origin while preserving subpath installs.
QA:
http://localhost:8065.http://127.0.0.1:8065and sign in as a system admin.http://127.0.0.1:8065/plugins/mattermost-ai/..../mattermost, verify requests include/mattermost/plugins/mattermost-ai/....Validated with the focused Jest regression test and the repository
make checksuite (all lint, type, Go, webapp, shard, and drift checks passed; lock drift was rerun with the repository's Node 24.11 toolchain).Ticket Link
Jira https://mattermost.atlassian.net/browse/MM-70581
Screenshots
Release Note
Summary by CodeRabbit