microskills: a proposer reply with `"extractors": null` (or another wrongly typed field) aborts the fold, and the next session start pays for the proposer again
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with parse_payload and _rx in tokeneconomizer/microskills/distiller.py, then read the existing coverage in tests/test_generic_microskills.py. Reproduce the malformed proposer replies described in the issue and check how Distiller.update and fold_locked handle them. Done means wrongly typed entries are safely ignored, invalid patterns do not abort folding, and tests cover these cases.
索引モデルが issue の本文から書いたものです。
説明
What happens
parse_payload (tokeneconomizer/microskills/distiller.py) checks that the proposer's reply is JSON, but not the types inside it:
{"extractors": null, "facts": []}raisesTypeError: 'NoneType' object is not iterable.- An extractor whose
patternis a list raisesTypeError: unhashable type: 'list'in_rx, which only catchesre.error. - A fact whose
detectoris a string raisesAttributeErrorin_ground.
The guard added for #131 only covers the runner call. These errors come later, out of Distiller.update, so they abort fold_locked before folded.json or the ledger is written. The session stays pending, so the next session start folds it again and calls the proposer again.
Repro
Offline: six sessions through hook.main, with TE_MICROSKILLS=on, the default k = 3, and the proposer stubbed to answer {"extractors": null, "facts": []}.
paid proposer calls: 9 (2 expected)
folded.json: ['s0']
ledger records: 1
errors.log tail: TypeError: 'NoneType' object is not iterable
Why it matters
- A model that writes
nullfor "no extractors" makes every later session start call the proposer again. Each of those calls is billed, and none of them reach the ledger. - The envfacts layer, which makes no model calls, stops learning too.
A side note, not part of the fix
PROPOSER_SYSTEM asks for "ONLY a JSON list of <=4 such objects", and a few lines later for "a JSON OBJECT {extractors, facts}". A reply that follows the first instruction is dropped without any notice. The prompt is pinned by a hash in tests/test_generic_microskills.py, so I've left it alone.
I have a fix with tests ready: parse_payload keeps only entries with the expected types, and _rx returns None for a non-string pattern. Happy to open a PR if that approach works for you.
- 主要言語
- Python
- スター
- 5.6k
- フォーク
- 344
- 平均マージ
- 14時間 41分
- マージ済み PR(30日)
- 54
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TokenEconomizer のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/TokenEconomizer#193 ·
メンテナーはふだん 1 日以内に返信
-
pricing: Claude's 1-hour cache writes are priced at 1.25x, but billed at 2x対応中かも @anascherif が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
microsoft/TokenEconomizer#191 ·
メンテナーはふだん 1 日以内に返信
-
trace: Claude Code's `<synthetic>` notices count as requests and can make a Claude session price on the fallback curve対応中かも @1AbdullahButt が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
microsoft/TokenEconomizer#189 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
microsoft/TokenEconomizer#186 ·
メンテナーはふだん 1 日以内に返信
-
plugin: the agent-output readers crash on a JSON line that is not an object対応中かも @rahul05ranjan が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
microsoft/TokenEconomizer#182 ·
メンテナーはふだん 1 日以内に返信
microsoft/TokenEconomizer の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Treat corrupt-shape state files as missing in `load_state`対応中かも @Qrytics が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
OvertureMaps/overturemaps-py#175 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
awslabs/visual-asset-management-system#1278 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws-samples/sample-per-model-bedrock#835 ·
メンテナーはふだん 1 日以内に返信