Skip to content

[http] fix: keep asset aliases out of dashboard fallback - #302

Merged
Wangmerlyn merged 1 commit into
mainfrom
codex/static-asset-dot-aliases
Jul 2, 2026
Merged

[http] fix: keep asset aliases out of dashboard fallback#302
Wangmerlyn merged 1 commit into
mainfrom
codex/static-asset-dot-aliases

Conversation

@Wangmerlyn

Copy link
Copy Markdown
Owner

Summary

  • Treat dot-segment paths that resolve into packaged dashboard assets as asset requests.
  • Return structured JSON 404 responses for missing normalized asset aliases instead of serving the dashboard shell.
  • Update AGENTS.md and docs/guides/mcp.md with the static asset alias contract.

Test Plan

  • RED: PYTHONPATH=src pytest tests/mcp/test_http_api.py::test_http_normalized_asset_alias_returns_404_not_dashboard_index tests/mcp/test_http_api.py::test_http_head_normalized_asset_alias_returns_404_without_body -q failed before the fix with 200 dashboard responses.
  • GREEN: PYTHONPATH=src pytest tests/mcp/test_http_api.py::test_http_normalized_asset_alias_returns_404_not_dashboard_index tests/mcp/test_http_api.py::test_http_head_normalized_asset_alias_returns_404_without_body -q
  • PYTHONPATH=src pytest -q tests/mcp/test_http_api.py -k "missing_static_asset or normalized_asset_escape or normalized_asset_alias or head_static_success"
  • PYTHONPATH=src pytest tests/mcp/test_http_api.py -q
  • mkdocs build
  • pre-commit run --all-files --show-diff-on-failure

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Wangmerlyn, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6549cd9b-4daf-4c92-920f-3143bee5f510

📥 Commits

Reviewing files that changed from the base of the PR and between fddbc7f and 2fdb7ef.

📒 Files selected for processing (4)
  • AGENTS.md
  • docs/guides/mcp.md
  • src/keep_gpu/mcp/server.py
  • tests/mcp/test_http_api.py
📝 Walkthrough

[!WARNING]

Walkthrough skipped

File diffs could not be summarized.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/static-asset-dot-aliases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the MCP server to correctly handle dot-segment aliases that normalize into the assets directory, ensuring they return a structured JSON 404 error instead of falling back to the dashboard HTML shell. It also updates the documentation and adds corresponding GET and HEAD tests. The feedback suggests simplifying the path containment check in server.py by using Path.is_relative_to(), which is more idiomatic for Python 3.9+.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/keep_gpu/mcp/server.py Outdated
@Wangmerlyn
Wangmerlyn force-pushed the codex/static-asset-dot-aliases branch from fddbc7f to 2fdb7ef Compare July 2, 2026 11:42
@Wangmerlyn
Wangmerlyn merged commit c887d05 into main Jul 2, 2026
6 checks passed
@Wangmerlyn
Wangmerlyn deleted the codex/static-asset-dot-aliases branch July 2, 2026 11:48
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.

1 participant