Report whether a predict used the cached context or restored it (cache_outcome)

未关闭
#112 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@sunxiuguo 已经在做这个了。

开始于 2026年11月5日。

  • #115 来自 @sunxiuguo —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
api, backend

调研方向

Read src/tabctx/serve/service.py and src/tabctx/engine.py to trace how restore counts reach the predict response, then check src/tabctx/client.py for the result model. Use tests/unit/test_standalone_service.py for the hit case and tests/unit/test_spill.py to find how to trigger a spill. Done when both outcomes are reported correctly and the unit suite passes.

由索引模型根据 Issue 内容生成。

描述

area/api enhancement good first issue

A predict response says how long it took (latency_ms, timings_ms) but not whether the cached context was used as is, restored from the disk tier, or missing. Users can't see evictions, and slow restores look like slow predicts. (Item 3 of #46.)

What to do

  • Add cache_outcome: "hit" | "restored" to TabctxPredictResponse in src/tabctx/serve/service.py.
  • The engine already knows: TabctxEngine.predict counts restores with timing.count("restores") (src/tabctx/engine.py). Carry that through to the response; for coalesced requests the batch's outcome applies to all members.
  • Show it in PredictResult in src/tabctx/client.py (with a default, at the end).
  • Tests: tests/unit/test_standalone_service.py (a hit), and a spill test that restores (see tests/unit/test_spill.py for how to force a spill).

Done when

  • A predict right after a fit reports hit; one after the context was spilled reports restored.
  • uv run pytest tests/unit -n auto passes.
主要语言
Python
星标
1
派生
1
平均合并
6 小时 45 分钟
30 天内合并 PR
66

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

VectorInstitute/tabctx 的其他 Issue

查看 VectorInstitute/tabctx 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。