fix(llm): a non-ASCII execution handoff raises UnicodeEncodeError instead of ExecutionHandoffError
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in infrastructure/llm/execution/handoff.py around lines 202–204 and read the surrounding payload and signature validation. Add a unit test passing "é.abc" to consume_execution_handoff and asserting ExecutionHandoffError; follow the existing tests for this function. Done when the non-ASCII payload produces that documented error instead of UnicodeEncodeError.
Written by the indexing model from the issue text.
Description
The bug. consume_execution_handoff is meant to turn every bad handoff token into ExecutionHandoffError. A token with a non-ASCII character in its first half raises UnicodeEncodeError instead.
In infrastructure/llm/execution/handoff.py (:202-204), the payload half is encoded outside any try:
expected = hmac.new(
_signing_key(), encoded_payload.encode("ascii"), hashlib.sha256
).digest()
Reproduced on main:
| Token | Result |
|---|---|
"abc.def" |
ExecutionHandoffError (handled) |
"é.abc" |
UnicodeEncodeError (not handled) |
The only caller, dashboard/scripts/backtest_hourly_agent.py:343-344, catches only ExecutionHandoffError. So the worker exits with a raw traceback instead of its clean "invalid execution handoff" message. The signature half is already safe (_b64decode handles this), so the two halves behave inconsistently.
Impact is low. The token is written by the parent process over stdin, so this only happens with a corrupted or tampered handoff. No secret is exposed and nothing is billed. It's about failing the documented way.
Suggested fix. Wrap the encode (or the whole signature check) so a UnicodeEncodeError is raised as ExecutionHandoffError, the same way the payload decode below it already does. A unit test can pass "é.abc" and assert ExecutionHandoffError.
- Dominant language
- Python
- Stars
- 767
- Forks
- 156
- Avg merge
- 22h 2m
- Merged PRs (30d)
- 88
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Open-Finance-Lab/AgenticTrading
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Open-Finance-Lab/AgenticTrading#663 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Open-Finance-Lab/AgenticTrading#661 ·
Maintainers usually reply within 1 day
-
fix(backtests): an LLM action with trailing whitespace ("buy ") is silently droppedPossibly taken @subidhkhanal claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Open-Finance-Lab/AgenticTrading#658 ·
Maintainers usually reply within 1 day
-
fix(llm): Gemini adapter drops thinking tokens from the output countPossibly taken @subidhkhanal claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Open-Finance-Lab/AgenticTrading#657 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Open-Finance-Lab/AgenticTrading#591 ·
Maintainers usually reply within 1 day
All issues in Open-Finance-Lab/AgenticTrading
Similar issues
-
[Resource]: LoreOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 88/100
hesreallyhim/awesome-claude-code#3234 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openminion/openminion#376 ·
Maintainers usually reply within 1 day
-
Type: ☹︎ Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
posit-dev/great-tables#1028 ·
Maintainers usually reply within 1 day
-
integration: apple_tv
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/core#188282 · 1 comment ·
Maintainers usually reply within 1 day
-
A "since" range is worded as a career: "the past two seasons" says "regular season career (2025 on)"OpenP4: low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jeffknupp/association#538 ·