feat: reasoning-token costs, growing-zone overlap guard, auto-dismiss dialogs, camera director (#33, #34)#37
Merged
Conversation
… 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>
e2ff898 to
563f976
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33 and #34.
#33.1 — Reasoning-token cost tracking
TokenUsage/CostSnapshot/CostTrackernow carryreasoning_tokensand bill them at the completion rate. Thinking models bill hidden chain-of-thought that OpenRouter reports incompletion_tokens_details.reasoning_tokensbut leaves out ofcompletion_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_Riceis the correct defName (verified againstData/Core/Defs); barericeis not a real ThingDef. In the spread logsPlant_Ricesucceeded 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.Plant_Rice, adds a "create once" note.client.py): was correct all along (rice→Plant_Rice); documented.#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/closeendpoint. On by default;--no-dismiss-dialogsto opt out.#34 — Cinematic camera director
CameraDirectorjumps/zooms topawn_killed/pawn_downed/mental-break events, frames the colony during raids, spotlights the most-distressed colonist when idle, and writescamera_cues.jsonlfor the footage index. Opt-in via--camera-director. Backed by a new RIMAPIcamera/follow/pawnendpoint.Verification
ruff+mypy --strictclean.🤖 Generated with Claude Code