run_code selects the Code row by literal name, and every Code row sends typescript to the highlighter—even when the loaded runtime reports Python.Four layers. One hardcoded answer.
Add one narrow hint.
GenericCallView {
card: 'generic'
kind: 'execute'
rawInput: 'print("hello")'
language: 'python'
}
A banner and syntax grammar hint owned by the tool that produced the call view.
It cannot choose the runtime, executable, sandbox, permission, tool, or policy.
Require the semantic tuple.
card: generic+kind: execute+rawInput: string+language: non-empty→Code row
A language string alone cannot switch card families. Unknown grammar identifiers retain the banner and fall back to plain text; they never trigger an arbitrary dynamic import.
Keep old and new peers working.
Use the producer-owned body and language.
Keep legacy run_code behavior.
The optional field does not break decode.
No crash, fetch, execution, or guessed runtime.
Share one language source.
Persist the producer-owned hint with the call view. A later profile switch must not relabel an already durable execution.
Six release gates.
Primary evidence.
- rc.2 provider-neutral presentation types
- rc.2 Code Mode presenter and flavors
- rc.2 Web Code row
- Tool-owned code-card proposal #4724
Keep the full compatibility design.
The canonical guide adds the type proposal, view-first fallback matrix, wire and replay constraints, third-party example, failure router, and twenty regression gates.
Read and star on GitHub