warp icon indicating copy to clipboard operation
warp copied to clipboard

Bug Report: AI Feature Fails with YAML Deserialization Error

Open Albrz opened this issue 1 year ago • 11 comments

Pre-submit Checks

Describe the bug

When using the "Agent Mode" in Warp Terminal and making multiple queries in quick succession, I frequently encounter an error that prevents the request from being completed. The error message displayed is:

I'm sorry, I couldn't complete that request. Failed to deserialize AI response YAML: mapping values are not allowed in this context at line 7 column 181 response: thought_and_action:

This issue occurs after using the "Agent Mode" several times in sequence. It disrupts the workflow and causes the AI to become unreliable, especially for extended use.

Steps to Reproduce:

Open Warp Terminal and activate the "Agent Mode." Make multiple queries in sequence to the AI feature. Observe that, after several interactions, the error appears instead of a response. Expected Behavior: The AI should respond correctly to all queries without failing due to YAML deserialization issues, even after multiple interactions in "Agent Mode."

System Information:

Warp Terminal version: v0.2025.02.12.16.51.stable_03 OS: Ubuntu 22.04.5 LTS - Kernel 6.8.0-52-generic Additional Context: Let me know if you need any logs or additional details to help diagnose the issue.

Thanks!

To reproduce

Using the "Agent Mode" in Warp Terminal and making multiple queries in quick succession,

Expected behavior

Using the "Agent Mode" in Warp Terminal and making multiple queries in quick succession,

Screenshots

No response

Operating system

MacOS

Operating system and version

22.04

Shell Version

No response

Current Warp version

v0.2025.02.12.16.51.stable_03

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

Albrz avatar Feb 14 '25 11:02 Albrz

Ran into the same error, whilst in Agent mode (CMD + I) on M1 Pro MBP (MacOS 15.3.1), Warp v0.2025.02.19.08.02.stable_05

Image

The prompt that caused it:

I need to schedule a meeting with 5 people across different time zones.
- Alice is in New York (EDT) and available 9am-5pm local time
- Bob is in London (GMT) and available 10am-6pm local time
- Charlie is in Tokyo (JST) and available 8am-3pm local time
- David is in San Francisco (PDT) and available 8am-4pm local time
- Eve is in Sydney (AEST) and available 9am-4pm local time

Find all possible meeting times when everyone can attend, expressed in each person's local time.

The attached output is for claude haiku 3.5, but I got the same error with gemini-flash-2.0 and once for gpt-4o (it worked on the second attempt)

It looks like a YAML formatting error in the response returned by the model, somwhere around this section

response:
    thought_and_action:
        thought: |
            I'll create a Python script to calculate the overlapping time slots across these different time zones. 
            This requires converting each person's local available times to a common time zone and finding the intersection.
        action:
            code:
                files:
                    - meeting_scheduler.py
                query: |
                    Write a Python script that:
                    1. Defines time zones for each person
                    2. Converts their local available times to UTC
                    3. Finds the overlapping time slots
                    4. Converts the overlapping slots back to each person's local time
citations: []

Here is a solution at SO of the same error. Probably the system prompt needs to be edited to ensure YAML correctness of the response.

Here is the errored response on the same prompt from gemini-flash-2.0:

==== I'm sorry, I couldn't complete that request.

Failed to deserialize AI response YAML: unexpected character: ``' at line 1 column 1 Raw response:

response:
    answer:
        answer: |
            Finding a time that works for everyone across these time zones requires converting all availabilities to a common time zone (UTC is often easiest) and then converting back to each local time. This can be complex, and would likely be best handled by a dedicated scheduling tool or calendar application that understands time zones.

            However, I can outline the approach to solve this manually:

            1.  **Convert all availabilities to UTC:**
                *   Alice (New York, EDT = UTC-4): 9am-5pm EDT is 13:00-21:00 UTC
                *   Bob (London, GMT = UTC+0): 10am-6pm GMT is 10:00-18:00 UTC
                *   Charlie (Tokyo, JST = UTC+9): 8am-3pm JST is 23:00 (previous day) - 06:00 UTC
                *   David (San Francisco, PDT = UTC-7): 8am-4pm PDT is 15:00-23:00 UTC
                *   Eve (Sydney, AEST = UTC+10): 9am-4pm AEST is 23:00 (previous day) - 06:00 UTC

            2.  **Find the overlapping time in UTC:**
                *   Overlapping time needs to satisfy all the individual's availability
                *   Consider that Charlie and Eve's availability spans two days in UTC.
                *   The intersection of these times is between 15:00 UTC and 18:00 UTC

            3.  **Convert the overlapping time back to each local time zone:**
                *   Alice (New York, EDT = UTC-4): 11am-2pm EDT
                *   Bob (London, GMT = UTC+0): 3pm-6pm GMT
                *   Charlie (Tokyo, JST = UTC+9): Midnight - 3am JST (next day)
                *   David (San Francisco, PDT = UTC-7): 8am-11am PDT
                *   Eve (Sydney, AEST = UTC+10): 1am-4am AEST (next day)

            Therefore, a possible meeting time that works for everyone is 15:00-18:00 UTC, which corresponds to the local times listed above.

            Keep in mind that this assumes that Daylight Saving Time (DST) is in effect for all locations, given the "EDT", "PDT" and "AEST" designators. If DST is not in effect, the time zone offsets will be different and the calculations will need to be adjusted.

====

qazi0 avatar Feb 27 '25 16:02 qazi0

I also have this error, also Ubuntu 24.04.5 LTS, using Claude 3.7 Sonnet.

Slight difference in that it is line 7 column 160.

rebroad avatar Mar 12 '25 20:03 rebroad

same error. Windows 10, dispatch mode (o1 + claude 3.7 sonnet). My prompt and response is:

Image

I have not learned how to copy the output of warp, so I put a picture here.

gtaifu avatar Mar 16 '25 09:03 gtaifu

For me this happens when I explicitly told the agent to include a newline instead of url encoded characters. I suppose if an error like this happens, it should reprompt the model to get a correct yaml.

Clausinho avatar Mar 17 '25 07:03 Clausinho

I also ran into the same bug, but with a completely unrelated query. My query was

how do you make a cmake library in a subdirectory that depends on another library in a different subdirectory of the same project?

It gave me a full response which was correct, but when it asked me to execute the proposed steps, I got the same error, see below.

Given that the error occurs with very different, unrelated queries, it's almost certain that the bug has nothing to do with the queries themselves, but rather with how the AI agent formats its response.

I didn't select any particular LLM, and it is set to "auto (best model for the task)", but I think it may be Claude 3.7 sonnet. I'm on Ubuntu 20.04 and Warp version is v0.2025.03.12.08.02.stable_03.

==== The response is below ====

I'm sorry, I couldn't complete that request.

Failed to deserialize AI response: YAML error: mapping values are not allowed in this context at line 8 column 101
Raw response:
response: 
    thought_and_action:
        thought: |
            Now that we have created the directory structure, let's create the root CMakeLists.txt file 
            with the minimum required CMake version, project name, and subdirectory includes.
        action:
            code:
                query: Create a CMakeLists.txt file in the root directory with the following content:
                    `` `cmake
                    cmake_minimum_required(VERSION 3.10)
                    project(testcrosslib)

                    # Add the subdirectories
                    add_subdirectory(lib1)
                    add_subdirectory(lib2)
                    `` `

eposse avatar Mar 19 '25 17:03 eposse

I had the same issue several times in different situations.

"I'm sorry, I couldn't complete that request. Failed to deserialize AI response: YAML error: mapping values are not allowed in this context at line 7 column 155"

PDangelmaier avatar Mar 21 '25 08:03 PDangelmaier

Similar errors: Failed to deserialize AI response: YAML error: while parsing a block mapping, did not find expected key at line 15 column 17

Also seems like Warp retried the request a few times before displaying this error. Also, this error seems to block further input to the terminal session.

cephalonaut avatar Mar 21 '25 16:03 cephalonaut

I am getting the same error on my linux/ubuntu Device. Warp was workoing flawlessly until the latest update, then this issuie and a few others have made it quite spaztic. Will start collecting the other errors as they occur again. I was in agent mode and this was the command: mkdir -p ./game/tl/english and the response was as follows: I'm sorry, I couldn't complete that request.

Failed to deserialize AI response: YAML error: mapping values are not allowed in this context at line 7 column 101 Raw response: response: thought_and_action: thought: | Now that we've created the English translations directory, let's create a new common.rpym file with English translations. I'll create a basic English translation file based on the Russian one we saw. action: code: query: Create a new file at ./game/tl/english/common.rpym with the following content:  translate english strings:

                       # renpy/common/00accessibility.rpy:28
                       old "Self-voicing disabled."
                       new "Self-voicing disabled."

                       # renpy/common/00accessibility.rpy:29
                       old "Clipboard voicing enabled. "
                       new "Clipboard voicing enabled. "

                       # renpy/common/00accessibility.rpy:30
                       old "Self-voicing enabled. "
                       new "Self-voicing enabled. "

                       # renpy/common/00accessibility.rpy:32
                       old "bar"
                       new "bar"

                       # renpy/common/00accessibility.rpy:33
                       old "selected"
                       new "selected"

ontop01970 avatar Mar 22 '25 12:03 ontop01970

Getting the same error here, frequently. The frustrating part is that there's no way to pickup from where the agent left off so it's a hard fail and hard to know if a task was left halfway.

juanandresgs avatar Mar 25 '25 19:03 juanandresgs

Hey folks, sorry to hear about these errors. It can happen when the AI responds in a format that can't be parsed correctly (syntax errors). We're looking into this issues and we'll post any updates on this thread.

To anyone else facing this issue, please add a 👍 to the original post at the top or comment with your details, and subscribe if you'd like to be notified.

dannyneira avatar Mar 28 '25 22:03 dannyneira

I've just run into this on day 1, trying one of the suggested examples ("create a Matrix theme for Warp") right out of the box. It was on the step where it was about to create the YAML file for the theme. Downloaded Warp (Mac version) about 5 minutes ago.

And worse, it seems like once such an error happens, there is no way to recover short of quitting and restarting Warp. I don't have time for this — it's back to Terminal for me. You should consider removing this example if it is likely to fail.

JoeStrout avatar Apr 04 '25 14:04 JoeStrout