Skip to content

fix: handle malformed GitHub responses during repository analysis - #20

Merged
yyeret merged 1 commit into
mainfrom
codex/spec-kit-api-error
Oct 24, 2026
Merged

yyeret merged 1 commit into
mainfrom
codex/spec-kit-api-error

Conversation

@yyeret

@yyeret yyeret commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

Spec Kit analysis could crash with a plain-text 500 when GitHub returned a payload that was not a PR list. The dashboard then hid the server failure behind Unexpected token I while trying to decode that text as JSON. Malformed upstream responses now produce a sanitized JSON 502, and analysis/chat display useful HTTP failures even when a server response is not JSON.

Successful responses retain their existing behavior. This is a focused hotfix against the deployed code; it does not include the unmerged Jev feature.

Validation

  • Regression tests reproduced the original plain-text 500 and exact frontend JSON-parser error before the fixes, then passed.
  • 252 Python tests pass with 94.39% coverage; four Node tests execute the actual dashboard functions and pass. Ruff and all six security stages pass.
  • A fresh local HTTP API run using authenticated GitHub CLI transport returned 200 for Spec Kit: 429 merged PRs, 92 active PRs, 4.4 seconds. This omitted model calls and was not a native Workers test.
  • Simplification completed without edits. Focused code review completed with no actionable findings (spec-kit-api-error-review); Claude authentication failed and a separate local adversarial review completed instead.

The original malformed upstream body was not retained. Production recovery will be verified after the authorized deployment.


Compound Engineering

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-spec-kit-api-error-github-flow-analytics.yuval-yeret.workers.dev (commit 7871f17)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://20bea198-github-flow-analytics.yuval-yeret.workers.dev 7871f17 2026-10-24T16:31:33.084Z Visit the dashboard ↗

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tessl Reviewer

Advisory findings (1)

The malformed top-level GitHub-response handling and frontend non-JSON error reporting are in place. Nested malformed pull-request fields can still bypass the collector's controlled error path and produce an unhandled server error.

Severity Findings
Minor 1

Advisory findings (1)

  • Minor · Advisory · Non-blocking · Nested malformed pull-request fields still cause an unhandled analysis error
    analyze.py:359

Reviews are incremental. The first review shows every valid finding. A later round checks the latest changes and earlier findings, and adds a fresh finding when it still applies. It never repeats one you refuted or declined. Ask for a full review to inspect the whole change and show earlier findings again.

Mention @tessl-reviewer to run another review.

Comment thread analyze.py Resolved
@yyeret
yyeret merged commit 1c525e4 into main Oct 24, 2026
5 checks passed
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