Skip to content

fix: unicodeEncodeError when UIPATH_PROCESS_KEY contains non-ASCII characters#642

Merged
cristian-groza merged 2 commits intomainfrom
fix/header-encoding
Feb 27, 2026
Merged

fix: unicodeEncodeError when UIPATH_PROCESS_KEY contains non-ASCII characters#642
cristian-groza merged 2 commits intomainfrom
fix/header-encoding

Conversation

@cristian-groza
Copy link
Contributor

  • Agent or solution names containing non-ASCII characters are included in UIPATH_PROCESS_KEY, which is passed as the X-UiPath-ProcessKey HTTP header to the LLM Gateway
  • HTTP headers must be ASCII-only per RFC 7230; httpx enforces this with value.encode("ascii"), causing a UnicodeEncodeError that crashes the agent before it can execute
  • Fix: percent-encode the header value with urllib.parse.quote() so non-ASCII chars become ASCII-safe (e.g. 請 → %E8%AB%8B); server side can decode
    e.g.
    [2026-02-26 12:57:56.368] info: UiPath.Executor.CodedAgent.JobExecutors.PythonAgentJobExecutor[0] UIPATH_PROCESS_KEY=Solution.17.agent.GetCompanyIdAgentAgent-請-test

@cristian-groza cristian-groza merged commit 352f28a into main Feb 27, 2026
39 checks passed
@cristian-groza cristian-groza deleted the fix/header-encoding branch February 27, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants