feat(requestrouter): let request routers report download progress - #27
Conversation
Add an optional DownloadProgress to TargetStatus: a phase, bytes total and left summed over the target's distinct downloads, the latest estimated completion, and the number of downloads. A plugin declares that it fills it with request_router.reports_download_progress, which the host reads from the manifest to decide which targets to refresh every minute. The phase vocabulary is open, and bytes_total is 0 whenever any download's size is unknown, so hosts show no percentage rather than an overstated one. Refs #26 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe request-router protocol adds a declaration flag and a progress message for target status. Documentation describes progress values and host polling behavior. SDK tests cover manifest loading, validation, and metadata conversion for the new flag. ChangesRequest-router progress contract
SDK manifest and metadata handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The additive progress contract and compatibility coverage present no identified issue that needs resolution before merging. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new fields are additive, and older plugins remain outside progress reporting. No security issue is established in this PR, but the host behavior that will enforce the contract is not included, so its safeguards remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Problem
Closes #26
Related issue: Silo-Server/silo-server#1643
Validation tasks: none
Request-router plugins can tell Silo whether a request's download is queued, downloading, completed or failed, but not how far along it is, so Silo shows "Processing" for as long as a title downloads. Silo-Server/silo-server#1643 adds download progress to requests; this is the plugin contract it needs.
Approach
TargetStatus.progress(field 6) is a newDownloadProgresswith:Plugins set it only while a target is queued or downloading and the downstream service has something in its queue for it.
RequestRouterDescriptor.reports_download_progress(field 2) declares that a plugin fillsprogress. The host reads it from the stored manifest and refreshes only declaring plugins every minute. It ignores progress from any other plugin.The phase vocabulary is open:
queued,downloading,paused,stalled,importing,import_blocked. Hosts read an unknown value asdownloading.bytes_totalis 0 whenever any download's size is unknown, so a host shows no percentage rather than an overstated one.The README and
docs/compatibility.mdstate these rules. The convert and manifest tests cover the new flag, including manifests written before it existed.Compatibility and release
The change is additive: one new message and new fields, with no RPC changes.
buf breakingagainst main reports nothing. Plugins that never setprogress, and hosts that never read it, behave as before.Release it as v0.19.0 after merge. Three changes depend on it, and each is pinned to this branch's commit until the tag exists:
Validation
go test ./...,go vet ./...and the three example builds pass.gofmt -l .lists onlypkg/pluginsdk/runtime/scan_source_test.go, which is unchanged from main.buf generatewith the pinned generators reproduces main's generated code. After this change, onlyrequest_router.pb.gochanges.buf breaking --against '.git#branch=origin/main'reports nothing.make proto, because it requiresprotoc, which the build host lacks. I ranbuf generatedirectly, which is how the committed code was generated (its header readsprotoc (unknown)).Risks
None identified.
Checklist
AI Disclosure
progressmust carry a phase; the one-minute refresh applies only to declaring plugins; and the docs did not say whatbytes_totalmeans when only some sizes are known. The comments and docs now cover all three.🤖 Generated with Claude Code