Skip to content

Conversation

@relh
Copy link
Contributor

@relh relh commented Dec 24, 2025

Observation tokens changed their format and now have p1 and p2 for base-256 encoded amounts

  • Old format: only inv:<resource> existed, so values >255 were truncated. New format: multi-token inv:<resource>:p1, inv:<resource>:p2 are emitted when amounts exceed the base, extending the range.
  • Describe inventory encoding: inv:<resource> stores amount % 256, inv:<resource>:p1 stores (amount / 256) % 256, and inv:<resource>:p2 stores (amount / 256^2) % 256.
  • Why for Dinky: recent refactors emit the new power tokens; Nim agents were treating them as unknown features and reading only the base token, causing warnings and incorrect inventory values. This change maps and reconstructs the full amount.

Testing

  • Not run (not requested)

Copy link
Contributor Author

relh commented Dec 24, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@relh relh changed the title Handle inventory power tokens in Nim agents minimal handling of inventory power tokens in Nim agents Dec 24, 2025
@relh relh marked this pull request as ready for review December 24, 2025 05:00
@relh relh requested a review from treeform December 24, 2025 05:00
@relh relh enabled auto-merge December 24, 2025 05:20
@relh relh added the review wanted: stamp This PR needs a review from any available team member label Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review wanted: stamp This PR needs a review from any available team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants