Codex: "Cannot serialize value" when starting a Worktree chat, how to fix it
Back to the blog
Articlecodexgitagente de programaçãotroubleshootingdev tools

Codex: "Cannot serialize value" when starting a Worktree chat, how to fix it

MafraOctober 21, 20265 min read

You open a new chat in the Codex app, type anything, even a "hi", hit send, and the chat never starts:

Error starting chat
Cannot serialize value: (couldn't stringify value)

Since October 21, 2026 this shows up in the Codex desktop app version 26.1016.51333 (build 21161) on macOS, Windows and Linux. The reports are collected in openai/codex #55744, which passed 25 comments on its first day. The pattern everyone confirms: the error only happens when the new chat starts in Worktree mode. In Local, the same message goes through.

What causes "Cannot serialize value" in Codex?

The app fails while preparing a Worktree chat, before the worktree is even created. It is not your repository, not the message text and not an attachment: a short message with no files already reproduces it.

Users who inspected the installed build independently landed on the same spot: the error is a TypeError thrown while serializing the managedWorktrees.pending.create call, and the value the serializer rejects is the prompt document saved for history. The app logs record [Composer] submit failed with errorName=TypeError and mode=worktree. That analysis comes from the community, not from OpenAI. As of the morning of October 21, 2026 the issue was still open with no published fix.

How do I fix the error right now?

Turn Worktree off and send the message in Local. It is the workaround confirmed by several users on all three platforms, and it does not require restarting the app.

  1. In the new chat, look below the message box: the official docs call the option Worktree, and some reports find it as New worktree in the chat settings (gear icon).
  2. Switch to Local, or uncheck New worktree.
  3. Send the same message again.

The chat starts in the project's local checkout. The cost is losing isolation: the agent now edits the same folder you are working in.

Flow to work around the Cannot serialize value error in Codex: send in Local, move the chat with Hand off or create the worktree with git worktree add
From the error to the workaround. If it also fails in Local, it is a different problem and you should send the Feedback ID.

How do I keep working isolated in a worktree?

There are three paths. Only the first one has a report of working with the bug active, so start there.

1. Start in Local and move with Hand off

The official Codex docs describe Hand off, in the chat header, as the flow that moves a chat between Local and Worktree, taking the code along. In the issue, a Windows report says a chat started in Local can create and attach a managed worktree without error. In other words, the bug is in starting in Worktree, not in the worktree itself. Start in Local, send the first message and use Hand off to move the chat to a worktree.

2. Create a permanent worktree from the project

According to the docs, the three-dot menu on a project in the sidebar creates a permanent worktree, which shows up as its own project and is not deleted automatically. Nobody in the issue has reported whether this path avoids the bug. If you try it, open the chat there in Local.

3. Create the worktree yourself with git

This one does not depend on the app. You create the worktree from the terminal and open the new folder as a project, in Local mode:

cd ~/projects/app
git worktree add ../app-fix -b fix/my-task
git worktree list

Files ignored by git (.env, node_modules) do not come along. The docs note that .worktreeinclude only applies to worktrees managed by the app, not to ones you create from the command line. So copy what you need:

cp .env ../app-fix/
cd ../app-fix
npm install

When you are done, remove the worktree and the branch:

git worktree remove ../app-fix
git branch -d fix/my-task
PathIsolated from your checkoutTested with the bugSource
Local, no worktreeNoYes, several reportsIssue #55744
Local, then Hand offYesOne report (Windows)Issue #55744 and official docs
Permanent worktreeYesNo reportOfficial docs
git worktree add + Local projectYesDoes not depend on the appGit

What does not fix it?

Restarting the app does not help, according to several reports that reproduced the error before and after a restart. Reselecting the starting branch did not help either in the report that tried it. Changing the message text makes no difference, because the error does not depend on content.

What if the error also shows up in Local?

Then it is a different problem, because issue #55744 only covers Worktree mode. Send feedback from the app itself and paste the generated ID into a new issue at openai/codex, with version, operating system and chat mode. Several users on #55744 did that, and it is what helps OpenAI tell the cases apart.

When will OpenAI fix it?

There is no date. As of the morning of October 21, 2026 the issue was open, labeled bug, app and session. Watch for app updates and, when a new version ships, test a Worktree chat before going back to your old flow.

If you use worktrees so the agent can work without touching your folder, you can do that straight from the terminal. In Verboo Code, verboo --worktree fix-login creates the worktree at .claude/worktrees/fix-login, on a worktree-fix-login branch, and switches the session there. When you exit, it asks whether to keep or remove it.

Enjoyed this article?
Share knowledge with your network.
// Read also

Related articles