fix(sdk): openrunner install crashed with KeyError: 'id' on 2.37.0#430
Merged
Conversation
DERIVE_DATASET_CMD contained a literal REST path param `/datasets/{id}/lineage`.
str.format(prefix=...) treats every {...} as a field, so {id} raised
KeyError: 'id' and aborted the whole `openrunner install`.
Double the brace ({id} -> {{id}}) so .format emits it verbatim; {prefix}
stays the only real field. Add a regression test that renders every *_CMD
template and asserts no KeyError. Bump 2.37.0 -> 2.37.1.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jqueguiner
added a commit
that referenced
this pull request
Jun 30, 2026
) DERIVE_DATASET_CMD contained a literal REST path param `/datasets/{id}/lineage`. str.format(prefix=...) treats every {...} as a field, so {id} raised KeyError: 'id' and aborted the whole `openrunner install`. Double the brace ({id} -> {{id}}) so .format emits it verbatim; {prefix} stays the only real field. Add a regression test that renders every *_CMD template and asserts no KeyError. Bump 2.37.0 -> 2.37.1. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Bug
openrunner install(Claude Code / Codex) aborts withKeyError: 'id'on SDK 2.37.0 — no commands get written.Root cause
install_claude_code()/_install_all_commands_to_dir()render each slash-command template viastr.format(prefix="openrunner:").str.format()treats every{...}as a replacement field.DERIVE_DATASET_CMDcarried a literal REST path param (a doc example, not a template var):.format()only getsprefix=, notid=→KeyError: 'id'→ whole install crashes. Every other literal brace in the templates was already escaped{{...}}; this one was missed.Fix
{id}→{{id}}inDERIVE_DATASET_CMD(only true single-brace placeholder in any.format-ed template; lines 2185–2459 are real Python/JS written verbatim, not formatted — verified harmless).tests/test_install_commands.py: renders every*_CMDtemplate with.format(prefix=...), asserts noKeyError. 27 passed.2.37.0→2.37.1.docs/BUG-openrunner-install-2.37.0.md: root cause + workaround + fix + hardening note.Hardening (deferred)
str.format()over free-text is fragile — a new unescaped{...}re-breaks install. Robust route (.replace("{prefix}", ...)orstring.Template.safe_substitute) needs de-doubling all 80 existing{{...}}escapes; deferred. Regression test guards the current approach.🤖 Generated with Claude Code