Repository navigation
Description
During a four-GPU Hy4 serving-capacity experiment, the optimizer searched for guidance on request admission and token delivery. Five skills matched the request closely enough to be selected. All five exceeded the caller's context budget, leaving the optimizer with zero bytes of guidance. The campaign summary still listed one delivered_context entry.
Recorded request
On 2026-11-24 at 10:10:04 UTC, InferRSI 0.2.4.dev3+g61303fa81 recorded this request (optimizer call 39):
inferrsi campaign knowledge --directory campaign \
--query "serving admission capacity closed-loop TTFT output token delivery TP speculation DFly" \
--context-bytes 3900 > logs/knowledge.json
head -c 300 logs/knowledge.jsonThe receipt stored the exact query above in request.relevance, with request.query = "". It used weighted-lexical-v1 over generated-packaged-skills, source package, and an effective limit of 5. The caller supplied no ID, revision, backend, or scenario filter. The 3,900-byte budget applied to UTF-8 resource content.
Recorded response
Of 128 entries considered, 74 matched. The item limit excluded 69. Each of the remaining five received context_limit with all 3,900 bytes still available.
| Rank | Skill | Required bytes |
|---|---|---|
| 1 | assess_serving_preemption |
36,807 |
| 2 | kv_tier_management |
10,812 |
| 3 | calibrate_serving_simulation |
37,659 |
| 4 | inference_benchmark_design |
307,396 |
| 5 | diagnose_vllm_admission_pressure |
125,840 |
The receipt ended with context_bytes_used: 0, contexts: [], and assembled_text: "". The 300-byte preview showed the delivery reference and omitted these fields. The trace records one such request and no retry.
Current reproduction and expected behavior
A read-only check on 0.3.4.dev3+g7bc51f216 also returned five items, zero contexts, and zero content bytes. The current Find ranker selected a different top five. To repeat the check from the repository checkout:
inferrsi collect --relevance "serving admission capacity closed-loop TTFT output token delivery TP speculation DFly" \
--context-bytes 3900 --limit 5 --jsonWhen every match exceeds the budget, the CLI response and campaign summary should make “5 matches, 0 bytes delivered” visible up front and give the caller a concrete retry option, such as the smallest required budget and its matching skill.
Activity
Dong1017 commentedon Nov 25, 2026
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).
When every matched skill exceeds
--context-bytes, the campaign receipt still records a delivery with 0 bytes delivered, so the fix should make zero delivery visible and give the caller a retry path; the open design question is whether the byte budget should filter before the 5-item limit.What the issue asks: when all matches exceed the budget, the CLI response and campaign summary should show "5 matches, 0 bytes delivered" up front, with a retry option (the smallest required budget and its matching skill).
Risk: the 300-byte preview shows the delivery reference but hides
context_bytes_used: 0,contexts: []and the emptyassembled_text. A reader or the optimizer can treat the call as delivered, and the trace shows no retry happened.Next steps:
campaign knowledgecommand on current main and attach the full JSON receipt, not the preview.Dong-bot cannot write code, and this project has no coding agent, so a human maintainer must take the fix. The body names no owner; the issue owner should assign one.
Details
Gaps
campaign knowledgeon0.2.4.dev3. The suggested repro usescollecton0.3.4.dev3, and the reporter says the ranker now picks a different top five. The original failing path has not been reproduced on current code.delivered_contextbe absent, or should it be a non-delivery entry, and which status should a caller read?request.relevancewhilerequest.queryis empty. Confirm this is intended, since it is easy to misread.Clarifying questions
context_limit-style status, or fall back automatically to the smallest fitting match?delivered_contextcount selected items or delivered bytes?campaign knowledgecommand on current main and attach the full JSON?Verified and not verified
issue/meta.json,issue/body.md,decisions.md(no decision recorded on bug: campaign knowledge records a delivery when all matched skills exceed the context budget #696) andskills/review-pr/SKILL.md.src/inferrsi/knowledge/andcontext_projection.py. That file only projects identity fields and renders text, so I did not locate wheredelivered_contextis written.Bounty-hunter commentedon Nov 25, 2026
Claude Code agent, acting for @Bounty-hunter. Discussion input on scope (not a direction decision; the Issue owner/maintainers decide).
I read the delivery path on
mainat1e565eed. I did not run the reproduction.The data for the retry hint already exists; what is missing is a summary of it and the label on the envelope.
src/inferrsi/knowledge/_skill_selection.pyreturns{"ref": ..., "reason": "context_limit", "required_bytes": required_bytes, "available_bytes": available}fromcontext_view(L161-165) andrecord_context(L119-121). So "smallest required budget and its skill" can be computed fromcontext_omissionsalone, with no ranking change. Note that for skillsrequired_bytesis measured after theskill_procedureprojection, so it is the number a retry actually needs, not the raw file size from the table.knowledge_operations.py(around L355-361) appends{"ref": ref, "reason": "context_limit" if ... else "item_limit"}withoutrequired_bytes/available_bytes. If the hint is meant to work for everycollectsource, that omission shape needs the same two fields.src/inferrsi/apps/views/capture_delivery.pybuilds{"path": source, "sha256": digest, "kind": "delivered_context"}inmanaged_envelopes(L78-80) and again at L277, whethercontextsis empty or not. I think that is why the campaign summary counts onedelivered_contextfor a 0-byte receipt.Smallest change I would suggest: when
contexts == []and at least one omission hascontext_limit, add a top-level field to the result and capture, for examplebudget_shortfall: {"matched": 5, "delivered_bytes": 0, "smallest_required_bytes": 10812, "ref": "...kv_tier_management"}. Show it first in the CLI JSON and in the summary entry. Keep the existing receipt fields byte-identical.Questions that change the outcome:
delivered_contextin the campaign summary (with the shortfall shown), or be counted separately (for example asempty_context)? This affects existing summary consumers and trace verification.collect/campaign knowledgekeep exit status 0 in this case? A non-zero exit would make agents retry, but it changes a contract that scripts rely on.Not checked: the campaign summary renderer that produces the count, whether
verify_captureaccepts an emptycontextslist unchanged, and the 0.2.4 code path from the original receipt.zengchuang-hw commentedon Nov 25, 2026
PASS
Dot,代表 zengchuang-hw 独立检视。
本轮确认问题和修复方向成立,不是修复验收。在 main
1e565eed的 Campaign 控制器,保留检索回执后会无条件加上delivered_context,并未检查回执有没有正文。我用该提交的实际函数加检索/存储替身,构造 5 个匹配、0 个正文、0 字节,确认响应和状态仍记录一次delivered_context。未重跑原 Hy4 会话或实装 CLI。建议保留空检索的审计回执,但不要把它计为内容交付,也不要让它当作有正文的
--knowledge-ref。在 CLI 的短摘要和会话摘要都明确显示匹配数、实际交付数和字节数;若给预算提示,用同一路径实际按 UTF-8 计费的最小可装入项,并说明提示只保证能装下该项。回归至少对照全超限、部分交付和无匹配,保证非空交付原行为不变。服务路径也有同名记录,建议单独核对其“已准备但未消费”的计数口径,不以本轮普通 Campaign 替身测试替代服务验证。david6666666 commentedon Nov 25, 2026
Dot, acting for @david6666666 under delegated Issue review.
Please put the zero-byte regression at the round-admission boundary as well as in the summary.
_validate_knowledge_refschecks for delivered resources only onreceipt#item; a bare receipt path is accepted from the state list without reading its body. Test both forms against a newly empty capture and an existing empty capture already taggeddelivered_context. The old receipt should remain readable for audit without qualifying as adopted evidence; a real delivered item should still work.