Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Generated pictures are JPEG bytes saved under a .png name

Ouverte
#1,586 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
75/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go
Domaine
backend, cli

Piste de recherche

Start with internal/provider/media.go:156-169 and internal/session/tools_media.go to trace how generated bytes are written for both the codeaf image command and generate_image. Reproduce the issue with the supplied isolated-profile command and inspect the output with file. Done when the output is PNG data for a .png path, or is saved as .jpg with that choice reported to the user.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area:tools bug sev:serious

Seen on: dev 837b2b0.

Behaviour

codeaf image … --out media/plane.png and the chat's generate_image with path media/banner.png both wrote JPEG data (file: JPEG image data, 2048x2048 and 2048x1152). The agent noticed and re-encoded on its own. A file should match its extension: convert, or save under .jpg and say so.

Replication

  1. Build dev 837b2b0 (git checkout 837b2b0 && make build, binary bin/codeaf), or install the dev build with curl -fsSL https://agentfield.ai/get/devaf | bash.
  2. Use an isolated profile: export HOME=$(mktemp -d), export OPENROUTER_API_KEY, and keep the default model (~deepseek/deepseek-v4-flash-latest, crew on auto).
  3. On a busy machine set task.max_load to 0 (/settings, Tasks) so the busy-machine gate does not hold tasks.
  4. cd $(mktemp -d) && mkdir media && codeaf image "a paper plane on a desk" --out media/plane.png.
  5. file media/plane.png.

Evidence

  • file media/plane.png → JPEG image data, … 2048x2048.
  • internal/provider/media.go:156-169 and internal/session/tools_media.go: the returned bytes are written under the requested name without a type check.

Guessed cause

A guess from reading the code, not a confirmed diagnosis. The provider returns JPEG despite the PNG request, and the bytes are saved under the asked name without checking the type.

Acceptance

  • e2e: after the command above, file media/plane.png reports PNG image data (or the file is saved as plane.jpg and the command says so).

Found while writing the public docs; manual text differences are in #1545.

🤖 Generated with Claude Code

Langage dominant
Go
Étoiles
115
Forks
14
Merge moyen
9 h 44 min
PR mergées (30 j)
766

Préparer son environnement

Nous n'avons pas encore vérifié les fichiers d'installation de ce projet. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Agent-Field/CodeAF

Toutes les issues de Agent-Field/CodeAF

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.