Skip to content

Let an agent ask for a sprite sheet that keeps its background - #11

Merged
TheDesignFounder merged 1 commit into
mainfrom
feat/sprite-background-keep
Sep 27, 2026
Merged

TheDesignFounder merged 1 commit into
mainfrom
feat/sprite-background-keep

Conversation

@TheDesignFounder

Copy link
Copy Markdown
Owner

What

options.background is live in the App and the public API (GET /v1/capabilities now advertises sprite_pricing.plain_frame_cents: 7), but this server could not pass it on: the options schema sets additionalProperties: false, so background was rejected before it reached the gateway, and spriteCreditPrice only knew the transparent tier.

  • background: "remove" | "keep" in the options schema and the ManagedExecuteInput type, with a description that says what keep costs and when not to use it.
  • spriteCreditPrice(frameCount, background): keep is a flat 7 cents a frame with no tier, so 12 frames quote 5.0 credits instead of 9.9. Quoting the tier for a kept sheet also over-capped max_credits.
  • validateSpriteInput rejects an unknown value before any dispatch.
  • A spelled-out background: "remove" is normalised off the wire. The server fingerprints the options it receives, and remove is exactly what an absent field already means, so passing it through would split one job into two idempotency identities.
  • README and the dreamlayer_generate / dreamlayer_capabilities descriptions now cover the mode, and mention that a frame that will not cut out is retried nearby and can ship with its background rather than failing the sheet.

Verification

pnpm test 67/67. The five price cases, the wire-normalisation case and the dispatch case were each confirmed to fail with the change reverted (6 failures), so they test the behaviour and not themselves.

Not verified: no paid sprite job was run against a live provider.

🤖 Generated with Claude Code

The App and the public API accept options.background, but this server's
schema set additionalProperties: false, so an agent could not send it and
spriteCreditPrice could only quote the transparent tier. A kept-background
sheet is a flat plain_frame_cents per frame with no tier, about half the
transparent price, so quoting the tier also over-capped max_credits.

A spelled-out background: "remove" is normalised off the wire, because the
server fingerprints the options it receives and the default is what an
omitted field already means; passing it through would split one job into two
idempotency identities.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TheDesignFounder
TheDesignFounder merged commit d6b4d81 into main Sep 27, 2026
1 check passed
@TheDesignFounder
TheDesignFounder deleted the feat/sprite-background-keep branch September 27, 2026 02:00
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.

1 participant