Skip to content

[WRONG BRANCH] fix(kimi): read the usages.limit_* quota shape before the legacy one - #6

Closed
vadymhimself wants to merge 1 commit into
release/2.65.0-vadymhimself.15from
fix/kimi-usages-parser
Closed

vadymhimself wants to merge 1 commit into
release/2.65.0-vadymhimself.15from
fix/kimi-usages-parser

Conversation

@vadymhimself

@vadymhimself vadymhimself commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

KIMI-USAGES-PARSER (Vadym 19319; GW-CD-19243 spec, "Not in scope" list). be-low-chief wrote the diff (fork16.diff); the fork teammate reviewed it and commits it here (19202).

  • parseKimiQuotaPayload in src/providers/quota/vendor-probes-key.ts reads Kimi's current /coding/v1/usages shape: usages.{limit_5h, limit_7d, limit_month_total}, each {used_ratio 0..1, reset_time}. The field names were checked against MoonshotAI/kimi-code packages/oauth/src/managed-usage.ts.
  • These map to the 5h, weekly and monthly windows.
  • limit_month_code is not a separate window. It is the coding share of the monthly total, and Kimi's own CLI shows it only as a breakdown (usage-format.ts).
  • When usages is present, it is the only thing read: the legacy limits[] / totalQuota blocks can be zero-use placeholders.
  • When usages is absent, the legacy parse is unchanged.
  • A { data: { usages } } envelope unwraps the same way as the legacy fields.
  • tests/providers/provider-quota.test.ts grew, so its ratchet baseline goes to the new size.

Based on release/2.65.0-vadymhimself.15. CI keeps the known release-branch failures until #5 merges. Rebase this PR on the branch after that.

Test plan

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 6, 2026
@github-actions github-actions Bot changed the title fix(kimi): read the usages.limit_* quota shape before the legacy one [WRONG BRANCH] fix(kimi): read the usages.limit_* quota shape before the legacy one Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (release/2.65.0-vadymhimself.15); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft November 6, 2026 04:21
Kimi's /coding/v1/usages now returns usages.{limit_5h, limit_7d,
limit_month_total, limit_month_code}, each {used_ratio 0..1, reset_time}
(MoonshotAI/kimi-code packages/oauth/src/managed-usage.ts). When usages is
present it alone is read (5h, weekly, monthly total); the legacy limits[] /
totalQuota blocks can be placeholders. Without it, the legacy parse is
unchanged. Diff by be-low-chief (Vadym 19319).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@vadymhimself

Copy link
Copy Markdown
Collaborator Author

Superseded by #30: the same change rebased onto the current release line (version .24), with its main test loading a documented Kimi sample from fixtures/external/kimi/.

vadymhimself added a commit that referenced this pull request Nov 15, 2026
…(rebased #6) (#30)

Co-authored-by: Gauge <gauge@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
vadymhimself pushed a commit that referenced this pull request Nov 16, 2026
…ites (lidge-jun#8590)

* devin: opt-in Cognition blocklist rewrite on history data surfaces

The blocklist sanitizer only touched instruction surfaces (tool descriptions, the #2 system prompt); data fields stayed byte-exact, so one quoted trigger phrase anywhere in a long thread history made every later request fail with upstream permission_denied.

New OPENCODEX_DEVIN_SANITIZE_DATA_SURFACES=1 opt-in extends the same rewrites to message text (#3), tool-call arguments (#6.3), image captions (#10.3) and replayed thinking (#11). Identifiers (tool name, tool_call_id) and opaque signature blobs stay byte-exact. Off by default: rewriting literal history changes what the model sees, so refusing stays the default failure.

The permission_denied hint now names the opt-in. Tests pin both modes: data literal by default, rewritten when enabled.

* devin: add Codex CLI boilerplate phrases to Cognition blocklist rewrites

Two more live-isolated triggers in the Codex CLI developer boilerplate: the identity sentence "Codex refers to the open-source agentic coding interface" and the "Don not output ANSI escape codes directly — the CLI renderer applies them" bullet. Both are rewritten meaning-preservingly like the existing entries. Also adds the dump/bisect probe scripts used to isolate the triggers.

* fix(devin): drop stale signatures after thinking sanitization

Keep reasoning signatures only when the serialized thinking is unchanged.
Preserve signature-only replay and default-off sanitization, and add wire,
authentication and continuity regressions with matching adapter docs.

* chore(devin): keep live credential probes out of the runtime PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant