Skip to content

Image tool history can poison later prompts and mask provider failures #19

Description

@lyrishark

Summary

Several related image-generation reliability bugs can combine into severe prompt-adherence failures:

  1. Historical image tool arguments are shortened to literal strings ending in ... [truncated]. The LLM can imitate those examples in new generate_image calls, so the provider receives an incomplete prompt.
  2. HTTP-successful uniform black images are saved and reported as successful generations.
  3. Configured default negative_prompt values are ignored unless the LLM supplies a per-call value.
  4. Per-call aspect-ratio overrides mutate shared generator config, and several NanoGPT size mappings are not divisible by 16.
  5. All non-Venice models are advertised as accepting image references, including text-to-image-only NanoGPT models.

Reproduction evidence

In one long image-testing conversation:

  • Earlier calls persisted prompts around 700-1,000 characters.
  • Four consecutive later calls persisted prompt lengths of 68, 69, 68, and 70 characters.
  • Each short prompt literally contained [truncated], copied from historical tool-call context.
  • NanoGPT flux-kontext returned an HTTP-successful uniform black PNG on several requests; Psycheros saved it, captioned it, and told the entity generation succeeded.
  • A NanoGPT GPT Image request using the existing 2:3 mapping failed because 683x1024 is not divisible by 16.
  • Pony/CyberRealistic behaved as generic text-to-image models while system context labeled them as anchor-capable.

Expected behavior

  • Historical tool arguments should not contain imitation-prone fake prompt text.
  • The entity should receive the real saved image path for follow-up inspection.
  • Blank provider placeholders should be surfaced as errors.
  • Saved negative prompts should apply by default.
  • Request-scoped dimensions should not mutate config and should satisfy provider constraints.
  • Anchor support should be based on provider/model capability.

Locally verified patch

A local patch now:

  • omits prompt and negative_prompt from historical image tool JSON;
  • preserves the real generated path in the entity-visible tool result;
  • applies configured negative prompts;
  • clones request-scoped aspect-ratio params and uses 16-divisible NanoGPT dimensions;
  • treats captions identifying uniform black/empty output as provider errors;
  • distinguishes known NanoGPT editing models from text-to-image-only models.

Verification: 13 focused tests pass in the fork, 9 pass in the installed source, and controlled live Flux/Pony image checks succeeded after restart.

No private images, prompts, credentials, or user-identifying data are included here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions