Skip to content

Mark which folded parameters the tool cannot run without - #33

Open
CNSeniorious000 wants to merge 1 commit into
mainfrom
mark-folded-params-required
Open

Mark which folded parameters the tool cannot run without#33
CNSeniorious000 wants to merge 1 commit into
mainfrom
mark-folded-params-required

Conversation

@CNSeniorious000

Copy link
Copy Markdown
Owner

A parameter Python cannot spell — "a b", "1st", "" — is folded into **kwargs and named in a trailing comment. The comment gave names only:

async def probe(
    *,
    ok: str,
    **kwargs: Any  # spell as dict keys: "a b", "c d"
)

Nothing there says the tool cannot run without "a b". It reads exactly like the optional "c d" beside it, so the model calls without it and the host rejects the call — which is the failure the comment above that line says the note exists to prevent: "a required argument the model never sees is one the host rejects it for."

-    **kwargs: Any  # spell as dict keys: "a b", "c d"
+    **kwargs: Any  # spell as dict keys: "a b": str, "c d": int = ...

Spelled the way the named fields directly above it already are (${p.name}: ${p.type}${p.required ? '' : ' = ...'}), so the two readings of the same signature do not need separate rules. Types come along for free, which the folded half was missing entirely.

Note

On main this comment is the only place these parameters are named at all — py/kernel.py sets dropped = True, appends a bare kwargs, and says nothing about what went in. The note that makes <tool>? the second reading is in #23, unmerged. So today this is not two views disagreeing; it is the one view being incomplete.

Verification

node test/smoke.js passes. Two existing assertions pinned the names-only wording and were updated; a third case is new, because none of the existing fixtures had a folded parameter that was required — the half the change is actually about. Mutation-checked: reverting the render to rest.map((p) => JSON.stringify(p.name)) fails both the updated assertion and the new one.

A cross-half assertion — one schema, driven through toolSpecs into both the block and a live kernel, comparing the folds and their requiredness — belongs with #23, since that is where the kernel gains a note to compare against. Written and confirmed to fail against main for the right reason (folded.__doc__ is just the description).

@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.

Sorry @CNSeniorious000, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

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