Skip to content

fix(cli): tolerate denied endpoint experiment access - #475

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/cli-command-failure-analysis-8967
Closed

fix(cli): tolerate denied endpoint experiment access#475
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/cli-command-failure-analysis-8967

Conversation

@cursor

@cursor cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep tg beta endpoints retrieve working when access proxies allow the endpoint but deny optional A/B and shadow experiment subresources
  • return empty ab and shadows collections in JSON output when those optional requests are forbidden
  • add regression coverage for the observed 403 response

Tests

  • pytest tests/cli/test_beta_endpoints_retrieve.py tests/cli/test_beta_endpoints_rm.py tests/cli/test_beta_endpoints_ab.py tests/cli/test_beta_endpoints_shadow.py -q -n 0 (41 passed)
  • ruff check and ruff format --check on changed files
  • pyright on changed files
Open in Web View Automation 

cursoragent and others added 2 commits July 24, 2026 14:04
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
@broly-code-security-scanner

Copy link
Copy Markdown

Broly Security Scan

Note

Clean scan
No vulnerabilities detected in this PR.

Note

Re-scan this PR anytime with /broly scan — useful after /broly undismiss, or to refresh findings without a new push.

Broly — SAST (zai-org/GLM-5.2) · Secrets · SCA · GH Actions (zizmor) · Containers · SBOM · Powered by Together AI

@blainekasten

Copy link
Copy Markdown
Contributor

@cursoragent what prompted this change? I'm not sure I understand the error that this is fixing

@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Short answer: Amplitude cli_command_failed telemetry, not a hand-filed bug.

Your Ingest CLI Errors automation picked up ~8 failures of endpoints retrieve (CLI 2.27.1) with:

403 - Endpoint access requires a canonical endpoint API path
blocked_by: eval_proxy_endpoint_path_guard
path: .../endpoints/.../abExperiments

retrieve fan-outs 3 GETs: endpoint + abExperiments + shadowExperiments. The proxy allows the canonical endpoint path but 403s the experiment subpaths, so optional enrichment killed the whole command.

Fix: swallow PermissionDeniedError on those optional lists → return ab: [] / shadows: [] and still print the endpoint.

Replied on the PR with the same detail.

Open in Web Open in Cursor 

@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Prompted by the Ingest CLI Errors and attempt to fix them automation (cli_command_failed Amplitude events), not a hand-filed bug.

What was failing

tg beta endpoints retrieve <ep_...> --json (CLI 2.27.1) was dying with:

Error code: 403 - {
  'error': 'Endpoint access requires a canonical endpoint API path',
  'blocked_by': 'eval_proxy_endpoint_path_guard',
  'method': 'GET',
  'path': '/v2/projects/.../endpoints/.../abExperiments'
}

Seen ~8 times in the last-day export.

Why retrieve blew up

endpoints retrieve fan-outs 3 calls in parallel:

  1. GET .../endpoints/{id} (the actual retrieve)
  2. GET .../endpoints/{id}/abExperiments (optional enrichment)
  3. GET .../endpoints/{id}/shadowExperiments (optional enrichment)

eval_proxy_endpoint_path_guard allows the canonical endpoint path, but 403s the experiment subpaths. Because those optional calls weren’t tolerated, the whole command failed even when the endpoint itself was readable.

Fix

Catch PermissionDeniedError on the ab/shadow list calls and return [], so retrieve still succeeds with empty ab / shadows.

Original agent run: https://cursor.com/agents/bc-4f07af68-1eb6-46e4-9a25-a3a5c555e1e6

@togethercomputer togethercomputer deleted a comment from cursor Bot Jul 27, 2026
@togethercomputer togethercomputer deleted a comment from cursor Bot Jul 27, 2026
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