Skip to content

fix(sdk): openrunner install crashed with KeyError: 'id' on 2.37.0#430

Merged
jqueguiner merged 1 commit into
mainfrom
fix/install-keyerror-id
Jun 30, 2026
Merged

fix(sdk): openrunner install crashed with KeyError: 'id' on 2.37.0#430
jqueguiner merged 1 commit into
mainfrom
fix/install-keyerror-id

Conversation

@jqueguiner

Copy link
Copy Markdown
Owner

Bug

openrunner install (Claude Code / Codex) aborts with KeyError: '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 via str.format(prefix="openrunner:"). str.format() treats every {...} as a replacement field. DERIVE_DATASET_CMD carried a literal REST path param (a doc example, not a template var):

Verify: `GET /datasets/{id}/lineage` ...

.format() only gets prefix=, not id=KeyError: 'id' → whole install crashes. Every other literal brace in the templates was already escaped {{...}}; this one was missed.

Fix

  • {id}{{id}} in DERIVE_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).
  • New tests/test_install_commands.py: renders every *_CMD template with .format(prefix=...), asserts no KeyError. 27 passed.
  • Bump 2.37.02.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}", ...) or string.Template.safe_substitute) needs de-doubling all 80 existing {{...}} escapes; deferred. Regression test guards the current approach.

🤖 Generated with Claude Code

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
jqueguiner merged commit 510ea7b into main Jun 30, 2026
11 checks passed
@jqueguiner
jqueguiner deleted the fix/install-keyerror-id branch June 30, 2026 10:03
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>
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