OpenAIConverseConverter drops all but the first toolResult of a parallel tool call, and json results
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
- 76/100
Direzione di ricerca
Read memory/integrations/strands/converters/openai.py, especially _bedrock_to_openai and message_to_payload, then compare its behavior with AgentCoreMemoryConverter. Reproduce the round trip using parallel toolResult blocks and a JSON result. Done means every result and its content survive restoration, consecutive tool messages are merged for Converse history, and the described reproduction passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
With converter=OpenAIConverseConverter, a Strands agent that makes parallel tool calls stores only the first tool result. Strands puts every result of a parallel tool-use turn into one user message (strands/event_loop/event_loop.py:960), but _bedrock_to_openai (memory/integrations/strands/converters/openai.py, the if content and "toolResult" in content[0] branch) converts only content[0]. After restore, the assistant turn has N toolUse blocks and the next user turn has one toolResult, so the next Converse call fails the toolUse/toolResult pairing check (the same ValidationException class as #245).
It also keeps only text parts, so a tool result with a json block is restored as [{"text": ""}].
To Reproduce
from strands.types.session import SessionMessage
from bedrock_agentcore.memory.integrations.strands.converters.openai import OpenAIConverseConverter as C
def roundtrip(msg):
payload = C.message_to_payload(SessionMessage(message=msg, message_id=0))
events = [{"payload": [{"conversational": {"content": {"text": t}, "role": r.upper()}}]} for t, r in payload]
return [m.message for m in C.events_to_messages(events)]
results = {"role": "user", "content": [
{"toolResult": {"toolUseId": "t1", "status": "success", "content": [{"text": "sunny"}]}},
{"toolResult": {"toolUseId": "t2", "status": "success", "content": [{"json": {"temp_c": 21}}]}},
]}
print([b["toolResult"]["toolUseId"] for m in roundtrip(results) for b in m["content"] if "toolResult" in b])
# ['t1'] (AgentCoreMemoryConverter returns ['t1', 't2'])
A single result whose content is only {"json": {...}} comes back as [{"text": ""}].
Expected behavior
Every toolResult survives the round trip with its content, as with the default AgentCoreMemoryConverter.
Suggested fix
Emit one OpenAI role: "tool" message per toolResult (message_to_payload already returns a list), serialize json parts with json.dumps, and in events_to_messages merge consecutive restored tool messages back into one user message so the history keeps the alternation Converse requires.
Additional context
Reproduced on main. Not covered by #245 (default converter, different cause) or #718 (reasoning bytes only).
- Lingua principale
- Python
- Stelle
- 786
- Fork
- 163
- Merge medio
- 4h
- PR unite (30g)
- 22
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 aws/bedrock-agentcore-sdk-python
-
bug high-severity
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
aws/bedrock-agentcore-sdk-python#752 ·
I maintainer di solito rispondono entro 1 giorno
-
OpenAIConverseConverter restores an empty history when one blob or text payload fails to parseApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
aws/bedrock-agentcore-sdk-python#751 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
delete_all_long_term_memories_in_namespace deletes only the first 10 recordsForse già presa @Fire162 l’ha presa 18 giorni fa. Apertabug high-severity
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
aws/bedrock-agentcore-sdk-python#727 ·
I maintainer di solito rispondono entro 1 giorno
-
MPP: credential is always sent in Authorization, ignoring header="Payment-Authorization" in the challengeForse già presa @abhiramshaji-cyber l’ha presa 24 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
aws/bedrock-agentcore-sdk-python#702 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] update_message fails with parameter validation error when SessionMessage.message_id is a Strands positional integer indexForse già presa @citizen204 l’ha presa 144 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
aws/bedrock-agentcore-sdk-python#556 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws/bedrock-agentcore-sdk-python
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
snap-stanford/Biomni#380 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
microsoft/playwright-python#3361 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation priority: low size: S status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cubrid-lab/sqlalchemy-cubrid#1397 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation priority: low size: S status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cubrid-lab/pycubrid#1307 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Installer hides SSL certificate errors as bare URLError, and the suggested fix can't workApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
ShaftHQ/chaosengine-harness#143 ·
I maintainer di solito rispondono entro 1 giorno