Conversation
…ver; bump @atxp/client to ^0.11.7 The `atxp image` command was dropping any model/aspect-ratio the user wanted to pin — `imageCommand(prompt)` only forwarded the prompt to `image_create_image_async`. That left the server-side default in charge which, for direct MCP callers (no atxp-pics wrapping), recently caused a production incident where the default `gpt-4o-mini` path produced unfaithful outputs until the env var was switched to `gpt-image-2`. This adds: - `--model <model>` — forwarded as the tool's `model` arg (gpt-image-2, gpt-4o, dall-e-3, gemini-3-pro-image-preview, etc.) - `--aspect-ratio <ratio>` (also accepts `--aspectRatio` for parity with the underlying tool parameter name) — forwarded as `aspectRatio` Empty/unset options are not added to the args object so server defaults still kick in when nothing is specified. Also bumps `@atxp/client` from `^0.10.5` to `^0.11.7` to match what production MCP servers (image, music) are running. The 0.10.x series predates the middleware-settlement work and several payment-protocol fixes that landed in 0.11.x; the API surface used here (`atxpClient`, `ATXPAccount`) is unchanged. `npm install` regenerated `package-lock.json`. Help text + README usage examples updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
AI Code Review
Recommendation: APPROVE
Summary
This PR surfaces --model and --aspect-ratio flags for the atxp image command, passing them through to image_create_image_async, and bumps @atxp/client from 0.10.5 to 0.11.7 (resolved to 0.11.8) to align with the MCP server releases.
Actionable Feedback (2 items)
-
packages/atxp/src/index.ts:300-307—imageOptions(including the--modelparse) is evaluated unconditionally for every command. Currently harmless becauseimageOptionsis only consumed in theimagecase, but if any future command adds its own--modelflag it would silently conflict. Consider scopingimageOptionsparsing inside theimagebranch ofmain(), or add a comment noting the global parse is intentional. - General: The
@atxp/client0.11.x bump pulls in a substantial new transitive dependency tree —viem(2.48.4),@x402/core,@x402/evm, and a suite of@noble/*/@scure/*cryptographic primitives — adding several hundred kB to the install footprint. The PR description explains why (payment-protocol fixes, middleware-settlement work), but it's worth ensuring downstream consumers are aware of the size increase, particularly in size-sensitive CI environments.
Detailed Review
Code Quality
The implementation is clean and minimal. The ImageOptions interface is well-typed, the conditional args construction is idiomatic and correct (only appends optional fields when non-empty, so server defaults are preserved), and the getArgValue('--model', '') || undefined pattern correctly converts empty strings to undefined. Accepting both --aspect-ratio and --aspectRatio is a nice ergonomic touch. The change is fully backward-compatible: the options parameter defaults to {} so all existing callers are unaffected.
The pattern exactly mirrors how musicOptions/MusicOptions is handled, keeping the codebase consistent.
Security
No injection risk — options are passed as JSON object properties to an MCP tool call, not interpolated into a shell command. The new cryptographic transitive dependencies (@noble/*, @scure/*) are well-audited libraries widely used in the web3 ecosystem. No credentials or sensitive values are introduced.
Suggestions
The usage string in the error path now correctly reflects the new flags. The help text and example additions in help.ts are clear and match the actual CLI surface.
Positive Notes
- Minimal, focused diff — exactly the surface area needed and no more.
- Consistent with existing option-passing patterns (
musicOptions). - The
argsobject approach (only set fields when provided) is the right way to avoid accidentally overriding server defaults with empty strings. - Lock file cleanup (removing nested
chalk/qrcode-terminalfromcreate-atxp) is a welcome housekeeping item.
There was a problem hiding this comment.
AI Code Review
Recommendation: APPROVE
Summary
This PR surfaces --model and --aspect-ratio flags on the atxp image command, forwarding them as tool arguments to image_create_image_async, and bumps @atxp/client from ^0.10.5 to ^0.11.8 to align with the MCP server versions.
Actionable Feedback (3 items)
-
packages/atxp/src/index.ts:306—--modelis a very generic flag name parsed from the fullprocess.argvregardless of active command. If any future command also registers--model, it will bleed intoimageOptions. Consider namespacing it (e.g.--image-model) or scoping arg parsing to the active command. -
packages/atxp/src/index.ts:152—getArgValue('--aspect-ratio', '')passes an empty string asshortFlag. It works (no real argv element is""), but it's misleading. The function signature implies a real short flag; passing''as a sentinel for "no short flag" suggests the function could use an optional second argument (shortFlag?: string). - General: The dependency bump introduces substantial new transitive packages —
viem(~2MB EVM library),@x402/core,@x402/evm, and the@noble/@scurecryptography suite. For a CLI tool, this is a meaningful bundle-size and attack-surface increase. Worth confirming with the team that the payment-protocol middleware in@atxp/client@0.11.xis intentionally a hard dependency rather than a lazy-loaded or optional one.
Detailed Review
Code Quality
The command-layer change in commands/image.ts is clean and idiomatic: the ImageOptions interface is well-typed, the default-omission guard (if (options.model) args.model = ...) correctly prevents empty-string overrides of server defaults, and the updated usage string is accurate. The index.ts wiring follows the exact same pattern as the existing musicOptions block, making it easy to read and consistent with the codebase.
The || undefined idiom (getArgValue('--model', '') || undefined) is correct: getArgValue returns undefined when the flag is absent, and the || undefined coerces an empty string (flag present but no value) to undefined. No crash path here.
Security
No credential handling or injection vectors introduced. The model/aspect-ratio values are passed as-is to an MCP tool call; input validation is delegated to the server, which is the right boundary for this CLI. The new @x402/evm payment-protocol dependency introduces EVM/blockchain crypto code — not a concern for this feature, but worth a supply-chain audit pass given the breadth of new packages.
Suggestions
- The
--aspectRatiocamelCase alias is a nice UX touch for parity with the tool parameter name. Consider documenting it in the help text as well (currently only--aspect-ratioappears there). - No automated tests cover the new flag parsing. The existing
index.test.tssuite would be a natural home for a couple of cases: flag forwarded when set, flag absent when not set, and the camelCase alias resolving correctly.
Positive Notes
- The
argsobject approach (only populating optional fields when non-empty) is exactly right and avoids subtle bugs where""vsundefinedbehaves differently server-side. - The PR description is thorough: it explains the incident that motivated the change, the version gap being closed, and provides a concrete smoke-test plan.
- The lockfile cleanup (removing hoisted
chalk/qrcode-terminaloverrides fromcreate-atxp) is a nice bonus tidy-up.
Summary
The
atxp imagecommand was silently dropping any model or aspect-ratio the user might want —imageCommand(prompt)only forwarded the prompt itself toimage_create_image_async. For direct MCP callers (i.e. anyone not going through the atxp-pics wrapper, which pinsIMAGE_MODEL=gpt-image-2), this means the server default decides, which during last week's incident silently routed togpt-4o-minivia the Responses API and produced unfaithful outputs. Surfacing these flags lets CLI/agent users pin the model and aspect ratio explicitly.This PR also bumps
@atxp/clientfrom^0.10.5to^0.11.7to align with what the MCP servers (image, music, videogen) are running. The 0.10.x series predates the middleware-settlement work and several payment-protocol fixes in 0.11.x; the API surface used here (atxpClient,ATXPAccount) is unchanged.Code shape
index.tsparses--modeland--aspect-ratio(also accepts--aspectRatiofor parity with the underlying tool parameter name). Empty/unset options are not added toargs, so server defaults still apply when nothing is specified.Local test plan
Verify in each case the tool args going to
image_create_image_asyncreflect what was passed (or omit the field cleanly when not supplied). The image MCP server logsInferred creator '...' from model '...'when a model is forwarded — easy way to confirm from the server side.🤖 Generated with Claude Code