You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WORKFLOW.md prompt loading can corrupt valid UTF-8 text when splitting front matter from the prompt body. This can make the rendered prompt invalid UTF-8 and cause Jason.encode!/2 to fail before Symphony sends turn/start to the Codex app-server.
I attempted to open a PR directly against openai/symphony, but GitHub returned permission errors from both gh pr create and the GitHub connector (CreatePullRequest / 403). I also tried to open an issue, but Issues are disabled for this repository. The branch above is ready for maintainers to pull or use to create the PR.
Root Cause
Workflow.split_front_matter/1 currently uses:
String.split(content,~r/\R/,trim: false)
Without the Unicode regex flag, \R can treat raw byte 0x85 as a newline-like NEL byte. Some valid UTF-8 Chinese characters contain 0x85 as part of a multibyte sequence. For example, 者 is encoded as E8 80 85.
In a workflow prompt containing text like:
> 维护者:Symphony Codex 自动维护。
that split can break the 者 byte sequence into invalid UTF-8. The rendered prompt then fails at Jason.encode!/2 inside Symphony before it reaches the Codex app-server.
Fix
The prepared branch changes workflow file line splitting to only split on explicit file line endings:
String.split(content,~r/\r\n|\n|\r/u,trim: false)
This preserves UTF-8 prompt text and still handles CRLF, LF, and CR line endings for front matter parsing.
Validation
Validated on the prepared branch:
mix format --check-formatted lib/symphony_elixir/workflow.ex test/symphony_elixir/core_test.exs
mix test test/symphony_elixir/core_test.exs
mix run -e '<UTF-8 workflow prompt Jason.encode! repro>' showed prompt_valid=true and jason_encode=:ok
mix test passed: 235 tests, 0 failures, 2 skipped
Note: the first full-suite run hit an existing timing-window flaky assertion in test/symphony_elixir/core_test.exs:575; rerunning that individual test passed, and the subsequent full-suite run passed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
WORKFLOW.mdprompt loading can corrupt valid UTF-8 text when splitting front matter from the prompt body. This can make the rendered prompt invalid UTF-8 and causeJason.encode!/2to fail before Symphony sendsturn/startto the Codex app-server.A ready fix branch is available here:
WSL0809:codex/fix-workflow-utf8-split4232e0d fix(elixir): preserve UTF-8 workflow promptsI attempted to open a PR directly against
openai/symphony, but GitHub returned permission errors from bothgh pr createand the GitHub connector (CreatePullRequest/ 403). I also tried to open an issue, but Issues are disabled for this repository. The branch above is ready for maintainers to pull or use to create the PR.Root Cause
Workflow.split_front_matter/1currently uses:Without the Unicode regex flag,
\Rcan treat raw byte0x85as a newline-like NEL byte. Some valid UTF-8 Chinese characters contain0x85as part of a multibyte sequence. For example,者is encoded asE8 80 85.In a workflow prompt containing text like:
> 维护者:Symphony Codex 自动维护。that split can break the
者byte sequence into invalid UTF-8. The rendered prompt then fails atJason.encode!/2inside Symphony before it reaches the Codex app-server.Fix
The prepared branch changes workflow file line splitting to only split on explicit file line endings:
This preserves UTF-8 prompt text and still handles CRLF, LF, and CR line endings for front matter parsing.
Validation
Validated on the prepared branch:
mix format --check-formatted lib/symphony_elixir/workflow.ex test/symphony_elixir/core_test.exsmix test test/symphony_elixir/core_test.exsmix run -e '<UTF-8 workflow prompt Jason.encode! repro>'showedprompt_valid=trueandjason_encode=:okmix testpassed: 235 tests, 0 failures, 2 skippedNote: the first full-suite run hit an existing timing-window flaky assertion in
test/symphony_elixir/core_test.exs:575; rerunning that individual test passed, and the subsequent full-suite run passed.Beta Was this translation helpful? Give feedback.
All reactions