Skip to content

fix(signals): bound fetchRepoFocusManifestFile's raw-content fetch with a timeout - #7101

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/focus-manifest-loader-fetch-timeout-7071
Jul 17, 2026
Merged

fix(signals): bound fetchRepoFocusManifestFile's raw-content fetch with a timeout#7101
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/focus-manifest-loader-fetch-timeout-7071

Conversation

@shin-core

Copy link
Copy Markdown
Contributor

What

fetchRepoFocusManifestFile (src/signals/focus-manifest-loader.ts) fetches a repo's .loopover.yml/.loopover.json from GitHub's raw-content CDN, trying up to 4 candidate paths in sequence — with no AbortSignal.timeout on any of them, unlike the bounded-fetch convention across src/review/** (alerts.ts 10s, enrichment-wire.ts 5s, visual/capture.ts 8s). It feeds the cold-cache path for resolving a repo's gate/review policy on webhook and sweep processing, so a slow or hanging github.com/ghraw response could stall manifest resolution for that repo with no per-request ceiling.

How

Add a named module-scoped MANIFEST_FETCH_TIMEOUT_MS (10s, matching the siblings' order of magnitude) and pass AbortSignal.timeout(MANIFEST_FETCH_TIMEOUT_MS) to each candidate-path fetch. A TimeoutError rejection is already handled by the existing broad catch that falls through to the next candidate, so no new catch branch is needed and the string | null return contract is unchanged.

Validation

Test added to the existing focus-manifest-loader.test.ts: every candidate fetch is called with an AbortSignal. Confirmed it fails against the unfixed code (no signal) and passes with the fix. typecheck clean; the loader suite passes.

Closes #7071

…th a timeout

fetchRepoFocusManifestFile fetches a repo's manifest from GitHub's
raw-content CDN across up to 4 candidate paths with no AbortSignal.timeout,
unlike the bounded-fetch convention in src/review/** (alerts.ts,
enrichment-wire.ts, visual/capture.ts). It's on the cold-cache path for
resolving a repo's gate/review policy on webhook/sweep processing, so a
slow github.com/ghraw response could stall manifest resolution.

Add a named MANIFEST_FETCH_TIMEOUT_MS (10s) and pass
AbortSignal.timeout(...) to each candidate fetch. A TimeoutError is already
handled by the existing catch that falls through to the next candidate.

Closes JSONbored#7071
@shin-core
shin-core requested a review from JSONbored as a code owner July 17, 2026 21:10
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 17, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.75%. Comparing base (ead6fdd) to head (fba5eae).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7101   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files         692      692           
  Lines       68808    68809    +1     
  Branches    18781    18781           
=======================================
+ Hits        64511    64512    +1     
  Misses       3302     3302           
  Partials      995      995           
Flag Coverage Δ
shard-1 43.34% <100.00%> (+<0.01%) ⬆️
shard-2 36.90% <100.00%> (+<0.01%) ⬆️
shard-3 33.16% <100.00%> (+<0.01%) ⬆️
shard-4 34.39% <100.00%> (+<0.01%) ⬆️
shard-5 31.67% <100.00%> (+<0.01%) ⬆️
shard-6 46.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/signals/focus-manifest-loader.ts 95.79% <100.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-17 21:33:44 UTC

2 files · 1 AI reviewer · no blockers · CI green · unstable

⏸️ Suggested Action - Manual Review

Review summary
This is a small, well-targeted fix that adds a 10s AbortSignal.timeout to each of the up-to-4 candidate fetches in fetchRepoFocusManifestFile, matching the bounded-fetch convention used elsewhere in src/review/**. The existing broad catch already swallows TimeoutError and falls through to the next candidate, so no new error-handling branch is needed and the string|null contract is preserved. The added test correctly asserts every fetch call carries an AbortSignal, verifying the fix rather than a fabricated scenario.

Nits — 3 non-blocking
  • The timeout constant's comment block is a bit verbose for a one-line constant; a shorter inline comment referencing fetchRepoFocusManifestFile's GitHub raw-content fetch has no AbortSignal.timeout, unlike its review/signals siblings #7071 would suffice.
  • No test verifies that a TimeoutError from AbortSignal.timeout is actually caught and falls through to the next candidate (the added test only checks the signal is passed, not the fallback behavior on abort).
  • Consider adding a test that mocks fetch to reject with a DOMException named 'TimeoutError' to explicitly exercise the fallback-to-next-candidate path under timeout, not just verify the signal is attached.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7071
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 61 registered-repo PR(s), 37 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor shin-core; Gittensor profile; 61 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: shin-core
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Solidity, Dart, Python, CSS, PHP, Rust
  • Official Gittensor activity: 61 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb 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.

LoopOver approves — the gate is satisfied and CI is green.

@JSONbored
JSONbored merged commit 29a4ab6 into JSONbored:main Jul 17, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchRepoFocusManifestFile's GitHub raw-content fetch has no AbortSignal.timeout, unlike its review/signals siblings

2 participants