Skip to content

fix: cap openai-image-gen --count at 16 to prevent runaway API spend#1

Open
cubic-dev-ai[bot] wants to merge 1 commit intomainfrom
fix/cap-image-gen-count
Open

fix: cap openai-image-gen --count at 16 to prevent runaway API spend#1
cubic-dev-ai[bot] wants to merge 1 commit intomainfrom
fix/cap-image-gen-count

Conversation

@cubic-dev-ai
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot commented Mar 25, 2026

Summary

  • Adds a hard MAX_COUNT = 16 limit to the openai-image-gen skill's --count argument
  • Validates count is within 1–16 range with clear error messages before any API calls are made
  • Documents the count limit in SKILL.md

Problem

The bundled openai-image-gen skill accepted an arbitrary --count and, for GPT image models, turned it directly into that many sequential calls to the OpenAI Images API with no upper bound. Only dall-e-3 had a guard (capped at 1). A bad prompt, mistaken slash command, or automation bug could trigger a large batch of paid image generations causing unexpected spend.

Changes

  • skills/openai-image-gen/scripts/gen.py: Added MAX_COUNT = 16 constant and validation that exits early with an error if --count < 1 or --count > MAX_COUNT
  • skills/openai-image-gen/SKILL.md: Added note documenting the count cap under "Other Notable Differences"

Test plan

  • Build passes (pnpm build)
  • Python syntax check passes
  • Test suite passes (803/804 files; 1 pre-existing unrelated failure in models-config test)
  • Pre-existing lint issue (unrelated pi-tool-definition-adapter.ts) — not introduced by this change

🤖 Generated with Claude Code


Summary by cubic

Caps the openai-image-gen --count at 16 to prevent runaway API spend. Validates counts are 1–16 before any API calls with clear errors, and documents the limit in SKILL.md.

Written for commit c0497cf. Summary will update on new commits.

The bundled openai-image-gen skill accepted an arbitrary --count and,
for GPT image models, turned it directly into that many sequential
calls to the OpenAI Images API with no upper bound. A bad prompt,
mistaken slash command, or automation bug could trigger a large batch
of paid image generations causing unexpected spend.

Add a hard MAX_COUNT = 16 limit with clear error messages for
out-of-range values (< 1 or > 16). Document the limit in SKILL.md.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@CHENY260
Copy link
Copy Markdown

CHENY260 commented Apr 5, 2026

Summary

  • Adds a hard MAX_COUNT = 16 limit to the openai-image-gen skill's --count argument
  • Validates count is within 1–16 range with clear error messages before any API calls are made
  • Documents the count limit in SKILL.md

Problem

The bundled openai-image-gen skill accepted an arbitrary --count and, for GPT image models, turned it directly into that many sequential calls to the OpenAI Images API with no upper bound. Only dall-e-3 had a guard (capped at 1). A bad prompt, mistaken slash command, or automation bug could trigger a large batch of paid image generations causing unexpected spend.

Changes

  • skills/openai-image-gen/scripts/gen.py: Added MAX_COUNT = 16 constant and validation that exits early with an error if --count < 1 or --count > MAX_COUNT
  • skills/openai-image-gen/SKILL.md: Added note documenting the count cap under "Other Notable Differences"

Test plan

  • Build passes (pnpm build)
  • Python syntax check passes
  • Test suite passes (803/804 files; 1 pre-existing unrelated failure in models-config test)
  • Pre-existing lint issue (unrelated pi-tool-definition-adapter.ts) — not introduced by this change

🤖 Generated with Claude Code


Summary by cubic

Caps the openai-image-gen --count at 16 to prevent runaway API spend. Validates counts are 1–16 before any API calls with clear errors, and documents the limit in SKILL.md.

Written for commit c0497cf. Summary will update on new commits.

@CHENY260
Copy link
Copy Markdown

CHENY260 commented Apr 5, 2026

Summary

  • Adds a hard MAX_COUNT = 16 limit to the openai-image-gen skill's --count argument
  • Validates count is within 1–16 range with clear error messages before any API calls are made
  • Documents the count limit in SKILL.md

Problem

The bundled openai-image-gen skill accepted an arbitrary --count and, for GPT image models, turned it directly into that many sequential calls to the OpenAI Images API with no upper bound. Only dall-e-3 had a guard (capped at 1). A bad prompt, mistaken slash command, or automation bug could trigger a large batch of paid image generations causing unexpected spend.

Changes

  • skills/openai-image-gen/scripts/gen.py: Added MAX_COUNT = 16 constant and validation that exits early with an error if --count < 1 or --count > MAX_COUNT
  • skills/openai-image-gen/SKILL.md: Added note documenting the count cap under "Other Notable Differences"

Test plan

  • Build passes (pnpm build)
  • Python syntax check passes
  • Test suite passes (803/804 files; 1 pre-existing unrelated failure in models-config test)
  • Pre-existing lint issue (unrelated pi-tool-definition-adapter.ts) — not introduced by this change

🤖 Generated with Claude Code


Summary by cubic

Caps the openai-image-gen --count at 16 to prevent runaway API spend. Validates counts are 1–16 before any API calls with clear errors, and documents the limit in SKILL.md.

Written for commit c0497cf. Summary will update on new commits.

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.

2 participants