Skip to content

Fix pformat_caller_frame() render failure - #503

Merged
goodboy merged 3 commits into
mainfrom
pformat_caller_frame_render_guard
Aug 20, 2026
Merged

Fix pformat_caller_frame() render failure#503
goodboy merged 3 commits into
mainfrom
pformat_caller_frame_render_guard

Conversation

@goodboy

@goodboy goodboy commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Fix pformat_caller_frame() render failure

Motivation

pformat_caller_frame(box_tb=True) passed an unsupported indent
keyword to pformat_boxed_tb(). Every send-side MsgTypeError could
therefore fail with a secondary TypeError while formatting itself,
masking the original message-spec violation.

The bug dates to 888af602 and is independent of the TIPC work where
it was discovered, so this PR isolates the red-test/fix pair for
landing directly on main before #493.

Summary

  • exercise both boxed and bare caller-frame rendering
  • pin rejection of unknown pformat_boxed_tb() keywords
  • remove the invalid indent='' call argument

Testing

tests/devx/test_pformat.py: 3 passed

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 the
two-file diff and the focused regression suite passes locally.


(this pr content was generated in some part by opencode using
gpt-5.6-sol (openai))

Links

`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`))
Copilot AI lite review requested due to automatic review settings August 19, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the pformat_boxed_tb() call inside pformat_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 raise TypeError.

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.

@goodboy goodboy changed the title Pformat caller frame render guard Fix pformat_caller_frame() render failure Aug 19, 2026
@goodboy goodboy mentioned this pull request Aug 19, 2026
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`))
@goodboy
goodboy merged commit 3690e43 into main Aug 20, 2026
8 checks passed
@goodboy
goodboy deleted the pformat_caller_frame_render_guard branch August 20, 2026 16:13
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