Skip to content

[codex] fix pty helper python annotations - #186

Merged
bmanturner merged 3 commits into
mainfrom
codex/fix-pty-helper-python-annotations
May 26, 2026
Merged

bmanturner merged 3 commits into
mainfrom
codex/fix-pty-helper-python-annotations

Conversation

@bmanturner

Copy link
Copy Markdown
Owner

Summary

  • Add postponed annotation evaluation to the PTY helper.
  • Keep helper import compatible with older /usr/bin/env python3 runtimes selected by Foglet's sanitized adapter environment.

Root Cause

The helper uses str | None type annotations. Under the sanitized PATH=/usr/bin:/bin used for door adapters, macOS can select an older system Python where those annotations are evaluated at import time and raise:

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

That crashes helper-backed external doors before the door process can launch.

Validation

  • rtk /usr/bin/env -i PATH=/usr/bin:/bin python3 -m py_compile priv/doors/pty/foglet_pty_adapter.py
  • rtk python3 test/priv/doors/pty/foglet_pty_adapter_test.py
  • rtk mix test test/foglet_bbs/doors/runner_test.exs:253 test/foglet_bbs/doors/runner_test.exs:704 test/foglet_bbs/doors/output_encoding_test.exs test/foglet_bbs/doors_test.exs

@bmanturner
bmanturner marked this pull request as ready for review May 25, 2026 21:56
@bmanturner
bmanturner merged commit 7ac9bf0 into main May 26, 2026
1 check passed
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.

1 participant