fix(storage-resize-images): a malformed model reply to CUSTOM_FILTER_PROMPT blocks the image (existing extension bug, also in the kit)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- firebase, typescript
Direzione di ricerca
Start with the two content-filter.ts files named in the issue: functions/src/content-filter.ts for the extension and kits/storage-resize-images/src/content-filter.ts for the kit. Trace how custom prompt replies are validated and how blocked results are logged, then read the nearby tests or run the relevant test commands. Done when a schema failure with a custom prompt is retryable and logged as a prompt error, while finishReason: "blocked" still follows the safety block path.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Affects the extension and the kit. Priority: medium. With CUSTOM_FILTER_PROMPT set, an image that should pass can be replaced by the placeholder, and the log blames the safety filters.
Problem
When the model's reply fails genkit's output schema check (must have required property 'response'), the code treats it as a block. One malformed reply turns a "no" into a placeholder, and the log says Image content blocked by Vertex AI content filters., which points the user at CONTENT_FILTER_LEVEL rather than the prompt. By reading, with DELETE_ORIGINAL_FILE=true a blocked image counts as a success, so the original is also deleted (not run).
Reproduced
CONTENT_FILTER_LEVEL=BLOCK_MEDIUM_AND_ABOVE, CUSTOM_FILTER_PROMPT="Does this image contain a cat?" and a custom placeholder. An image with no cat was uploaded three times to each side:
- Kit: placeholder in 2 of 3 runs.
- Extension: resized in 3 of 3 runs.
Direct calls with the extension's genkit version reproduced the schema failure on some replies. The moderation code is the same on both sides (by reading), so the split is put down to model nondeterminism.
Code
- Extension: content-filter.ts#L84, #L200-L203.
- Kit: content-filter.ts#L51-L60, #L140-L146.
Resolution
With a custom prompt, treat a schema failure as a retryable error rather than a block, and log a message that names the custom prompt. Keep the safety-filter block (finishReason: "blocked") as it is.
- Lingua principale
- TypeScript
- Stelle
- 979
- Fork
- 436
- Merge medio
- 2g 13h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/extensions
-
fix(firestore-send-email): kit/extension parity – ext:migrate truncates settings containing #Apertakits parity type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
firebase/extensions#3303 ·
I maintainer di solito rispondono entro 1 giorno
-
kits parity type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
firebase/extensions#3301 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation kits parity
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
firebase/extensions#3300 ·
I maintainer di solito rispondono entro 1 giorno
-
kits parity type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
firebase/extensions#3296 ·
I maintainer di solito rispondono entro 1 giorno
-
kits parity type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
firebase/extensions#3294 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di firebase/extensions
Issue simili
-
docker infra P1 security size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
josephfung/curia#2408 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ehmpathy/rhachet-roles-ehmpathy#1231 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue help wanted
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
danielw-sudo/agentuto#32 ·
I maintainer di solito rispondono entro 1 giorno
-
type:docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nightgauge/nightgauge#2836 ·
I maintainer di solito rispondono entro 1 giorno