Skip to content

fix(llm): read the first text block of a bedrock Converse response - #2288

Closed
zhiyanliu wants to merge 1 commit into
Graphify-Labs:v8from
zhiyanliu:fix/bedrock-converse-content-block
Closed

fix(llm): read the first text block of a bedrock Converse response#2288
zhiyanliu wants to merge 1 commit into
Graphify-Labs:v8from
zhiyanliu:fix/bedrock-converse-content-block

fix(llm): read the first text block of a bedrock Converse response

0ed06bb
Select commit
Loading
Failed to load commit list.
Graphify Labs / Graphify succeeded Jul 29, 2026 in 0s

Graphify — looks good

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Details

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

This PR adds a helper _bedrock_response_text to graphify/llm.py that scans the Bedrock Converse response's content blocks and returns the first block containing non-empty text, rather than assuming the text is at index 0. It replaces two existing hard-indexed content extractions (in _call_bedrock and _call_llm) with calls to this helper. The tests/test_image_vision.py file gains a new section of unit and end-to-end tests covering the helper's block-selection, fallback, and malformed-input behavior.

No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 600 functions depend on the 195 node(s) this change touches.

Health — this change adds coupling hotspots:

  • worse: _call_llm() — 7 callers, 15 callees
  • worse: _call_bedrock() — 3 callers, 6 callees

Verification — 600 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 410 function(s) in the blast radius were not formally verified this run