Originally filed as google-antigravity/antigravity-cli#1478; a repository collaborator directed us to post here instead, as that repo covers only the CLI surface. Cross-posting in full so the report lives in the right place.
This also looks like the same defect class as the existing forum report Antigravity 2.6 – Agent stuck on Working due to invalid UTF-8 in CortexErrorDetails, with one difference that matters: there the failure was transient, while here the bad content is persisted, so the affected conversation is permanently broken.
Environment
- App: Antigravity desktop app 2.29.0 (Windows x64,
language_server.exe), which shares the agent core (language server + jetski/cortex executor) with the CLI.agy --versionon the same machine reports CLI 1.5.3. - OS: Windows 11 (x64)
- Shell: PowerShell / Windows console tooling (tool outputs frequently in legacy code pages)
- Terminal: Antigravity desktop app (built-in)
Summary
Strings containing unpaired surrogate characters / invalid UTF-8 enter conversation state via tool error summaries and file names, are persisted verbatim, and then fail strict protobuf UTF-8 validation on every later serialization. We observed two distinct failure sites (details below). The paths involved are ones the earlier fixes do not cover: persisted conversation state and the executor’s google.protobuf.Value. All identifiers, paths and file names below are sanitized.
Steps to reproduce
As far as we can reconstruct:
- In a conversation, have a tool produce an error summary or result containing characters that decode to unpaired surrogates (in our case, a mis-decoded non-ASCII file name inside a tool result; on Windows, legacy-code-page tool output is a realistic source).
- Let the turn finish, so the content is persisted into the conversation state.
- Reopen the conversation.
- The conversation title loads, but loading the conversation state fails with
invalid UTF-8; the UI retries roughly every 2 seconds, indefinitely. The conversation can never be opened again (in one case it could not be deleted from the UI either). - Variant during execution: when similar content reaches a
google.protobuf.Valuemid-run, the executor aborts the whole run (error under Actual Behavior).
Expected behavior
Externally sourced strings (tool outputs, error summaries, file names) should be sanitized to valid UTF-8 at ingestion/persistence time (e.g. unpaired surrogates and invalid sequences replaced with U+FFFD), and a single bad string should never hard-fail protobuf marshaling for the whole session or run. Already-poisoned stored conversations should be repaired on load (sanitize-on-read) instead of remaining permanently unopenable.
Actual behavior
1. Session-state path: the conversation becomes permanently unopenable; the UI loops retrying the state load every ~2 s. No error is surfaced to the user; the view simply never finishes loading.
2. Executor path (sanitized excerpt of a real failure):
Error: agent executor error: generating and executing: proto: field google.protobuf.Value.string_value contains invalid UTF-8
| google3/third_party/gemini_coder/framework/executor/agentexecutor/agentexecutor.(*AgentExecutor).Run
| third_party/jetski/cortex/cortex.(*CascadeManager).executeOne.func1
| third_party/jetski/cortex/cortex.(*CascadeManager).executeOne.func2
Additional evidence — controlled experiment
We tested a local, reversible binary hotfix on language_server.exe (2.29.0) that lossy-replaces invalid bytes with ? at the single protobuf error site where the session-state failure occurred (length-preserving, pinned to the exact build hash, backup + one-command rollback). Result: the previously frozen conversation did load, rendered its history, and its step store kept advancing for about 3 minutes — then it stalled again when the same payload crossed a different serialization path, and a subsequent run hit the executor-path error above. Two conclusions:
- The diagnosis (unsanitized strings persisted in conversation state) is confirmed experimentally, not just inferred.
- Point fixes at individual marshal sites are not sufficient: the class has multiple unguarded string paths. Sanitization at ingestion/persistence, plus sanitize-on-load for existing stores, looks like the durable fix.
Independent corroboration that the app emits unpaired surrogates in its payloads: a downstream consumer of desktop-app hook payloads on the same machine hit UnicodeEncodeError: 'utf-8' codec can't encode character '\udcba' ... surrogates not allowed when encoding those payloads as UTF-8.
A downstream project has already proven the remedy pattern workable at its own boundary: the ghostel terminal’s fix for a related Antigravity output issue (dakra/ghostel, PR #778) validates strings at the boundary and falls back to a lossy decode instead of hard-failing — one bad string degrades gracefully rather than aborting everything.
Relation to earlier fixes
The Antigravity CLI 1.1.21 release notes mention fixing “the session stalling mid-response when a tool result or file diff contained invalid UTF-8”. The failures above were observed on the current desktop build (2.29.0), on paths that fix apparently does not cover.
Logs
Sanitized: account identifiers, conversation/trajectory IDs, user paths and file names removed. Fuller sanitized logs are available on request.