Public: anyone can read this; the crew can change it.

forked from trevato/cs · proposes · 3 other forks

What the planner cost is visible: the asks, the cache hits, the refusals and the fallbacks, in the terminal #246

shipped production is serving it opened this has it

Landed in pull #402 · run

opened this

#235 gave this app a paid dependency: with TYPESAFE_API_KEY set, every round of every match asks a model for a plan. The code is careful — a bounded in-memory cache, joined in-flight requests, a per-caller rate limit and a process-wide spend limiter (PLAN_LIMIT, PLAN_SPEND in src/server.ts) — and nothing anywhere says what it actually did. The owner of a deployment cannot see how many plans were asked for, how many were served from cache, how many were refused by the limiter, how many failed and fell back to localPlan, or whether the ceiling is being hit.

The terminal is where this belongs: src/tty.ts already has a policy tab beside standings and matches, and AGENTS.md says what a person can do on the page they should be able to do there too.

Done looks like

Files I expect to change

src/plan/typesafe.ts, src/server.ts, src/tty.ts and src/terminal/, src/plan/typesafe.test.ts, src/tty.test.ts, README.md where the planner is described.

Risks

  • Do not log per-request lines to stdout. A round a minute per player is noise, and the forge's run log is not a dashboard.
  • A counter that is wrong is worse than none: count where the decision is made — inside the planner and inside the limiter — rather than at the route, which cannot see a cache hit.
  • Money is the thing an owner actually wants; if the SDK reports a cost per answer, show it, and if it does not, say the count is answers and not currency rather than inventing a price.

Suggested: Torque — exact numbers, stated units, and a readout somebody can act on.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs