Fix pformat_caller_frame() render failure - #503
Merged
Conversation
`pformat_boxed_tb()` has never accepted an `indent` kwarg but `pformat_caller_frame(box_tb=True)` has been passing one since `888af602`. Nothing in the suite covered the branch, so the `TypeError` only ever surfaced from `_mk_send_mte()` — i.e. EVERY send-side `MsgTypeError` blew up while formatting itself and masked the real msg-spec violation behind a bogus `TypeError`. Red on purpose per the test-first convention; the 1-line fix lands next. Also pin `pformat_boxed_tb()`s signature so a future typo'd kwarg fails loudly at the call site instead of only when some rare error path runs. (this patch was generated in some part by `claude-code` using `claude-opus-5` (`anthropic`))
Just drop it — `pformat_boxed_tb()` spells its knobs `tb_box_indent`/`tb_body_indent`, and that fn's default (1-space box indent) is what the caller wanted anyway. Regressed-by: 888af60 (`pformat_cs()` mv into `.devx.pformat`) Found-via: `/run-tests` test_pformat_caller_frame_renders (this patch was generated in some part by `claude-code` using `claude-opus-5` (`anthropic`))
There was a problem hiding this comment.
Pull request overview
This PR fixes an internal formatting bug where pformat_caller_frame(box_tb=True) could raise a TypeError due to passing an unsupported indent keyword argument to pformat_boxed_tb(), and adds unit tests to prevent regression.
Changes:
- Removed the unsupported
indent=''kwarg from thepformat_boxed_tb()call insidepformat_caller_frame(). - Added tests to ensure
pformat_caller_frame()renders for both boxed and unboxed modes. - Added a test to pin
pformat_boxed_tb()’s signature behavior by asserting unknown kwargs raiseTypeError.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tractor/devx/pformat.py | Removes an invalid kwarg so the boxed traceback path in pformat_caller_frame() cannot raise during formatting. |
| tests/devx/test_pformat.py | Adds regression coverage for the boxed/unboxed caller-frame rendering path and for rejecting unknown kwargs in pformat_boxed_tb(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
pformat_caller_frame() render failure
14 tasks
Once `pformat_caller_frame()` renders successfully, the default `_mk_send_mte()` path still fails while formatting the valid IPC msg spec and then constructs its error message as a one-element tuple. Pass `MsgCodec` to `pformat_msgspec()`, keep the assembled message a string and exercise the complete path through a printable `MsgTypeError` regression. Prompt-IO: ai/prompt-io/opencode/20260820T150250Z_9afda1c6_prompt_io.md (this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
pformat_caller_frame()render failureMotivation
pformat_caller_frame(box_tb=True)passed an unsupportedindentkeyword to
pformat_boxed_tb(). Every send-sideMsgTypeErrorcouldtherefore fail with a secondary
TypeErrorwhile formatting itself,masking the original message-spec violation.
The bug dates to
888af602and is independent of the TIPC work whereit was discovered, so this PR isolates the red-test/fix pair for
landing directly on
mainbefore #493.Summary
pformat_boxed_tb()keywordsindent=''call argumentTesting
The branch CI passes on Linux TCP/UDS, macOS TCP, Windows TCP, sdist
and docs. The macOS UDS leg hit the existing debugger-output timing
failure in
test_multi_subactors_root_errors; it is unrelated to thetwo-file diff and the focused regression suite passes locally.
(this pr content was generated in some part by
opencodeusinggpt-5.6-sol(openai))Links
AF_TIPCtransport backend #493