Summary
Two senpi built-ins disagree about how to match GPT model ids, which can deadlock editing on gateway-prefixed ids.
- The prompt-preset resolver recognizes prefixed ids like
codex/gpt-6-astra (boundary-aware regex), selects the gpt-6-astra preset, and injects: "Use apply_patch for ALL file edits and creations."
- The
gpt-apply-patch tool gate uses a literal prefix check model.id.startsWith("gpt-"), so the same prefixed id gets wireMode: "none" → the tool is registered but never activated, and lazy activation is refused.
Result: the generated developer instructions exclusively require a tool that the runtime reports as Tool apply_patch is registered but inactive — sessions refuse to edit via write/edit and stall.
Environment
@code-yeongyu/senpi 2026.9.19-2 (bun global install)
- Provider: OpenAI-compatible gateway exposing
codex/gpt-6-astra with api: "openai-completions"
- Baseline session model
glm/glm-5.3, switched mid-session to codex/gpt-6-astra
promptPreset: "auto"
Repro
Runtime repro against installed resolvePreset / getApplyPatchWireMode (selected tools read, edit, write):
| Model ID |
API |
Selected preset |
Contains patch-only instruction |
Patch wire mode |
glm/glm-5.3 |
openai-completions |
glm-5.3 |
No |
none |
codex/gpt-6-astra |
openai-completions |
gpt-6-astra |
Yes |
none |
gpt-6-astra |
openai-completions |
gpt-6-astra |
Yes |
json |
Extension-API mock (session_start with GLM → model_select with the prefixed astra id):
Registered: apply_patch
Active: read, edit, write
Lazy activation: false
Live symptom: calling the tool raises Tool apply_patch is registered but inactive. Active tools: read, edit, write, ...
Source references (installed 2026.9.19-2)
dist/core/extensions/builtin/prompt-preset/presets.js:36-40 — boundary-aware hasGpt6AstraSignal regex; :213-214 selects the preset
dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js:259 — calls buildFileOperationsTuning()
dist/core/extensions/builtin/prompt-preset/file-operations.js:23 — "Use apply_patch for ALL file edits and creations."
dist/core/extensions/builtin/gpt-apply-patch/extension.js:9-20 — isGptId literal startsWith("gpt-"); :75-84 refuses lazy activation when wireMode === "none"
dist/core/agent-session.js:2223-2225 — emits inactive_tool / "registered but inactive"
Suggested direction
- Make the two matchers consistent (e.g. boundary-aware
isGptId, mirroring the preset matcher, for prefixed gateway ids).
- Or make the file-operations tuning conditional on the tool actually being activatable for the current model+API.
- Preserve correct patch serialization for the selected API; merely force-enabling a registered variant does not establish correct format selection.
- Add regression coverage: bare vs prefixed GPT ids, supported vs unsupported APIs, non-GPT models, model switches in both directions.
- Assert the integration contract: a generated prompt must not exclusively require
apply_patch when it is inactive and edit/write are the available editing surface.
Summary
Two senpi built-ins disagree about how to match GPT model ids, which can deadlock editing on gateway-prefixed ids.
codex/gpt-6-astra(boundary-aware regex), selects thegpt-6-astrapreset, and injects: "Useapply_patchfor ALL file edits and creations."gpt-apply-patchtool gate uses a literal prefix checkmodel.id.startsWith("gpt-"), so the same prefixed id getswireMode: "none"→ the tool is registered but never activated, and lazy activation is refused.Result: the generated developer instructions exclusively require a tool that the runtime reports as
Tool apply_patch is registered but inactive— sessions refuse to edit viawrite/editand stall.Environment
@code-yeongyu/senpi2026.9.19-2(bun global install)codex/gpt-6-astrawithapi: "openai-completions"glm/glm-5.3, switched mid-session tocodex/gpt-6-astrapromptPreset: "auto"Repro
Runtime repro against installed
resolvePreset/getApplyPatchWireMode(selected toolsread,edit,write):glm/glm-5.3codex/gpt-6-astragpt-6-astraExtension-API mock (
session_startwith GLM →model_selectwith the prefixed astra id):Live symptom: calling the tool raises
Tool apply_patch is registered but inactive. Active tools: read, edit, write, ...Source references (installed 2026.9.19-2)
dist/core/extensions/builtin/prompt-preset/presets.js:36-40— boundary-awarehasGpt6AstraSignalregex;:213-214selects the presetdist/core/extensions/builtin/prompt-preset/gpt-6-astra.js:259— callsbuildFileOperationsTuning()dist/core/extensions/builtin/prompt-preset/file-operations.js:23— "Useapply_patchfor ALL file edits and creations."dist/core/extensions/builtin/gpt-apply-patch/extension.js:9-20—isGptIdliteralstartsWith("gpt-");:75-84refuses lazy activation whenwireMode === "none"dist/core/agent-session.js:2223-2225— emitsinactive_tool/ "registered but inactive"Suggested direction
isGptId, mirroring the preset matcher, for prefixed gateway ids).apply_patchwhen it is inactive andedit/writeare the available editing surface.