Skip to content

Stop telling the model to end cells on the raw tool result - #27

Merged
CNSeniorious000 merged 1 commit into
mainfrom
dont-echo-raw-tool-results
Aug 31, 2026
Merged

CNSeniorious000 merged 1 commit into
mainfrom
dont-echo-raw-tool-results

Conversation

@CNSeniorious000

@CNSeniorious000 CNSeniorious000 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

The block gave the model two rules that pull in opposite directions. One said a cell that is a single tool call needs no print at all — end it with await read(file_path=p) and the result comes back. The next said tool results consumed inside the cell never enter the conversation, so filter and aggregate in code and surface just the conclusion. The first is the cheaper habit and it is the one that gets followed, so the block was teaching the behaviour the rule below it asks the model to avoid.

One sentence, deleted. The rest of that bullet is untouched — the LAST-expression-is-the-return-channel rule is right, and print(...) for RESHAPING still reads exactly as before.

-- The cell's LAST expression is echoed back to you [...] A cell that is one tool call needs no `print` at all: end it with `await read(file_path=p)` and you get the result. Use `print(...)` when you want to RESHAPE what comes back [...]
+- The cell's LAST expression is echoed back to you [...] Use `print(...)` when you want to RESHAPE what comes back [...]

How this is measured

Per cell, consumed is the tool-result bytes it pulled in (tool/code-dispatch) and observed is what reached the conversation (tool/result), paired on callId. Cells are BANDED by consumed: in the < 2K band the median cell surfaces more than it consumed — those are cells that WRITE, whose output is text the cell generated, not a payload passed through. Only cells consuming a real payload say anything about extraction, so every number below is the 2K–20K band.

What it does on its own: not much

This PR and #30 shipped together as one arm against the codeact6 baseline, gpt-5.6-terra, 4/4 VLB tasks. Dump rate = share of cells surfacing ≥ 90% of what they consumed.

task baseline with #27 + #30
private_lending_33d 80.5% (n=41) 50.0% (n=42)
hsa_medical_bill_liquidity_guard_30d 72.7% (n=33) 29.2% (n=48)
food_safety_dispute_33d 44.7% (n=38) 100.0% (n=13)
broadcast_exam_posture_breathing_32d 9.1% (n=55) 38.2% (n=55)
pooled 47.3% (79/167) 43.7% (69/158)

Warning

z = 0.66, p = 0.51. The pair is a wash: large gains where the baseline was worst, losses of the same size where it was already decent. An earlier revision of this description reported the first row alone as a p = 0.0001 win — that was one task, and it was not representative.

The losses have a named cause: told to stop echoing the raw result, the model substitutes print(x['result'][:12000]), which the neighbouring bullet explicitly licenses as "show a slice of something large". #34 has the slice-bound histogram. #35 and #36 are what actually move the number — the same arm plus those two reaches 20.3% on the two tasks it has finished, against 77.0% for the baseline.

So the case for this PR is that the sentence is wrong — it tells the model to do the thing the next rule forbids — not that deleting it is sufficient. It is not.

@sourcery-ai sourcery-ai Bot 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.

你好——我已经审阅了你的更改,整体看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的审查结果,请考虑分享它们 ✨
帮助我变得更有用!请点击每条评论上的 👍 或 👎,我会利用这些反馈来改进审查结果。
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@CNSeniorious000
CNSeniorious000 merged commit 33d251a into main Aug 31, 2026
15 checks passed
@CNSeniorious000
CNSeniorious000 deleted the dont-echo-raw-tool-results branch August 31, 2026 04:43
Repository owner deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
Repository owner deleted a comment from coderabbitai Bot Sep 1, 2026
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