Skip to content

feat(kin): a price table for the carry cost gate - #1088

Merged
GLDRoger merged 6 commits into
kinfrom
fix/kin-cache-instructions-boundary
Nov 28, 2026
Merged

GLDRoger merged 6 commits into
kinfrom
fix/kin-cache-instructions-boundary

Conversation

@GLDRoger

Copy link
Copy Markdown
Owner

The carry cost gate (train 16's step 2) needs each model's relative token prices to tell whether continuing a session costs more than a fresh start. Kin had no such table, so the gate could never fire.

What changed:

  • cacheWeights(driver, model) in the turn provider gives relative prices for Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5, in units of plain input: read, 5-minute write, 1-hour write and output. Any other driver or model gets nothing, so the gate stays silent for it.
  • The carry runner now calls it directly on the owner-only Claude path. The placeholder that waited for it is gone.
  • Tests pin the table, and pin that the request every seat sends is byte for byte the same as before.
  • The idea this branch started with was tried, measured and reverted. A static-instructions cache boundary was meant to let fresh sessions reuse the instructions. Live captures showed fresh sessions still rewrote them on the tested route, so it was reverted in its own commit. A one-hour cache lifetime for shared chats was also dropped: priced on a recorded week, it never lowered cost.

People-change: none

Checked as part of train 16's one check at the tip.

An independent review (Claude Opus 5.5) found it LANDS AFTER FIXES. It dropped the shared-chat lifetime with a failing test first, and that commit is on this branch.

🤖 Generated with Claude Code

GLDRoger and others added 6 commits November 29, 2026 00:57
Mark the existing instructions as a reusable prefix and default shared chats to the same cache lifetime as the owner's chat. Record relative prices for known Claude models without activating a cost rule.

People-change: none
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Fresh sessions still rematerialize Kin's instructions through the gateway, even with equivalent plain API calls or an explicit scope. Restore the plain custom prompt; keep the shared-chat cache lifetime and neutral price weights.

People-change: none
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
With no instructions reused across fresh sessions, a one-hour write on
shared chats only pays when a later wake arrives 5-60 minutes after the
last request with the same prefix. On the recorded week that is 7 of 35
wakes against a break-even of 88%, so an install that honours the marker
pays about $0.07 more per shared wake; the recorded gateway bills every
write at one hour already, so there it changes nothing. Restore kin's
lifetime rule and pin it: owner 1h by default, explicit lifetimes win,
shared, bills, review and triage seats unset. cacheWeights stays.

People-change: none
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Joins fix/kin-cache-instructions-boundary (46045f8). No conflict.
Net of its three commits, it adds only cacheWeights(driver, model) in
turn/providers/provider.ts and tests that every seat's request matches
kin; the instructions boundary and the shared-chat lifetime were reverted
on the branch. Step 2's cost gate now prices with this export.

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly, and four models re-confirmed for train 16

With step 5's cacheWeights(driver, model) on the line, the optional shim
in WakeupRunner ("until then no turn is priced") is no longer true: call
the export directly. The test's comment no longer names a branch.

Re-confirm money, tasks, discussion and reply (their READMEs name
work/bills.ts, lead/LeadPrompt.ts and lead/WakeupRunner.ts): no spec
change, every rule holds and every broken variant is caught. No pin moved.

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People-change: none

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@GLDRoger
GLDRoger merged commit 7e273b0 into kin Nov 28, 2026
14 of 17 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T22:09:47.941732Z 121c711 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant