Skip to content

feat: reasoning-token costs, growing-zone overlap guard, auto-dismiss dialogs, camera director (#33, #34)#37

Merged
jkbennitt merged 1 commit into
masterfrom
feat/post-spread-fixes-33-34
Jun 11, 2026
Merged

feat: reasoning-token costs, growing-zone overlap guard, auto-dismiss dialogs, camera director (#33, #34)#37
jkbennitt merged 1 commit into
masterfrom
feat/post-spread-fixes-33-34

Conversation

@jkbennitt

Copy link
Copy Markdown
Member

Closes #33 and #34.

#33.1 — Reasoning-token cost tracking

TokenUsage/CostSnapshot/CostTracker now carry reasoning_tokens and bill them at the completion rate. Thinking models bill hidden chain-of-thought that OpenRouter reports in completion_tokens_details.reasoning_tokens but leaves out of completion_tokens — we were undercounting (deepseekv4 +187%, gemini35 +35%). Captured RLE-side from the raw provider response since felix is PyPI-pinned.

#33.2 — Growing-zone perseveration (issue premise was a misdiagnosis)

Plant_Rice is the correct defName (verified against Data/Core/Defs); bare rice is not a real ThingDef. In the spread logs Plant_Rice succeeded on tick 0, then every later tick failed "Invalid plant definition" because agents re-issue the zone over cells the tick-0 zone already owns — RIMAPI mislabelled the overlap as a def error.

  • Executor: overlap guard short-circuits duplicate/overlapping growing zones with a clear, agent-facing error.
  • Prompt: keeps Plant_Rice, adds a "create once" note.
  • Normalizer (client.py): was correct all along (ricePlant_Rice); documented.
  • RIMAPI-side error clarity + label fallback live in the fork (separate PRs).

#33.3 / #33.4 — Auto-dismiss force-pause popups

Colony-name dialog and dev-mode debug-log window are dismissed every tick via RIMAPI's new window/close endpoint. On by default; --no-dismiss-dialogs to opt out.

#34 — Cinematic camera director

CameraDirector jumps/zooms to pawn_killed/pawn_downed/mental-break events, frames the colony during raids, spotlights the most-distressed colonist when idle, and writes camera_cues.jsonl for the footage index. Opt-in via --camera-director. Backed by a new RIMAPI camera/follow/pawn endpoint.

Verification

  • 482 tests passing; ruff + mypy --strict clean.
  • New test suites for reasoning tokens, the overlap guard, and the camera director.

🤖 Generated with Claude Code

… dialogs, camera director (#33, #34)

#33.1 — Cost tracker now counts reasoning tokens. Thinking models bill
hidden chain-of-thought that OpenRouter reports in
completion_tokens_details.reasoning_tokens but leaves OUT of
completion_tokens; we were undercounting (deepseekv4 +187%, gemini35
+35%). TokenUsage/CostSnapshot/CostTracker carry reasoning_tokens and
bill them at the completion rate; base_role digs them out of the raw
provider response (felix is PyPI-pinned, so captured RLE-side).

#33.2 — Growing-zone perseveration. NOTE: the issue's premise was a
misdiagnosis — Plant_Rice is the correct defName (verified vs Core defs;
bare "rice" is not real) and it SUCCEEDED on tick 0 of the spread. Every
later tick failed "Invalid plant definition" because agents re-issue the
zone over cells the first zone already owns, and RIMAPI mislabelled the
overlap. Fix: executor now guards against overlapping repeats with a
clear error; prompt keeps Plant_Rice with a create-once note; the
client normalizer was correct and is documented as such. (RIMAPI-side
error-clarity + label fallback live in the fork.)

#33.3/#33.4 — Auto-dismiss force-pause popups (colony-name dialog,
dev-mode debug log) every tick via RIMAPI's new window/close endpoint.
On by default; --no-dismiss-dialogs to opt out.

#34 — CameraDirector drives the game camera to the action: jumps/zooms
to pawn_killed/downed/mental-break events, frames the colony during
raids, spotlights the most-distressed colonist when idle, and writes a
camera_cues.jsonl for the footage index. Opt-in via --camera-director.

Tests: +reasoning-token, +overlap-guard, +camera-director suites. Full
suite 482 passing, ruff + mypy --strict clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jkbennitt jkbennitt changed the title Post-spread fixes: reasoning-token costs, growing-zone perseveration, auto-dismiss dialogs, camera director (#33, #34) feat: reasoning-token costs, growing-zone overlap guard, auto-dismiss dialogs, camera director (#33, #34) Jun 11, 2026
@jkbennitt jkbennitt force-pushed the feat/post-spread-fixes-33-34 branch from e2ff898 to 563f976 Compare June 11, 2026 16:03
@jkbennitt jkbennitt merged commit c48b408 into master Jun 11, 2026
3 checks passed
@jkbennitt jkbennitt deleted the feat/post-spread-fixes-33-34 branch June 11, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-spread fixes before N=4: cost tracker reasoning tokens, Plant_Rice prompt, colony-name popup, debug log window

1 participant