Repository navigation
feat(cli): carry a session-start answer to the model on opencode and kilo - #1354
Closed
blafourcade wants to merge 6 commits into
Closed
blafourcade wants to merge 6 commits into
blafourcade wants to merge 6 commits into
Conversation
…kilo The OpenCode and Kilo bridges ran SessionStart with its output ignored. Probed on OpenCode 1.19.3 and Kilo 7.7.5: text pushed onto the V1 experimental.chat.system.transform output reaches the model. The bridges now read the hook's additionalContext and add it to the system prompt, per server on OpenCode and per created session on Kilo. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ode and kilo bridges Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bridges One generated capture spawns the script, collects its output and settles to a failure instead of rejecting. Both hosts build answerOf, stopReasonOf, the failure warning, the follow-up warning and the PostToolUse call mapping on it, so only the host name and whether a failed script is reported stay per host. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…code and kilo bridges Both host templates now pass only a session id and a directory; the payload, the run and the join live in the shared bridge, as does the dispatch warning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…session-start hand-over Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task
…ge reports The Stop call builder moves to the shared event bridge like SessionStart and PostToolUse, the dispatch warning is written only for the host that uses it, the host flag is named for what it decides, and the call builders nobody read are no longer exposed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Superseded by #1378, which consolidates the five OpenCode and Kilo bridge branches into one shared runtime (V1 and V2) and is merged on |
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.
🎯 What & why
SessionStart context never reached the model on OpenCode and Kilo: the bridges ran the hook with its output ignored. This wires the hook's
additionalContextinto the system prompt on both hosts. Partial work on #1348, which stays open.🛠️ How it works
additionalContext(exit 0 stdout, sameanswerFromas PostToolUse) and push it ontooutput.systemthroughexperimental.chat.system.transform.session.createdrun, and only to thatsessionID.runHook(stdio ignored) is removed from both bridges.answerOf: a spawn failure emitted two warnings (errorandclose). It now reports once. The existing "SessionStart spawn failure" test caught this once SessionStart moved ontoanswerOf.opencode/big-pickle) and Kilo 7.7.5 (kilo/kilo-auto/free) in a throwaway HOME. Text pushed onto the V1output.systemreached the model on both. Vendor types checked in@opencode-ai/pluginand@kilocode/plugindist/index.d.ts. Fixtures are captured verbatim from the probe, scrubbed of paths and session id.🧪 How to verify
cd cli && pnpm exec vitest run tests/contexts/tools/hooks-runtime-bridges.integration.test.tsif (context)guard, drop the OpenCode push, look up the last session's context instead ofinput.sessionID(test "leaves another session's system prompt alone"), remove the Kilofailedguard.7c8f709f1:make validate0,pre-commit --all-files0,clipre-push 0 (9907 passed, 1 expected fail, 15 skipped),pnpm build0. Bundle 879.0 KB / 897 KB.Goldens moved, all because the generated bridge text changed:
tests/fixtures/hooks-routes/{kilo,opencode}/flat-translate, plugin-install, plugin-install-twice, plugin-remove, setup-plugins-reinstall (10 files)cli/tests/golden/snapshots/framework-build/golden.jsonandtranslate-install/golden.json(opencode and kiloaidd-context-hooks.jshashes)cli/type-assertions-baseline.json:hooks-runtime-bridges.integration.test.tslowered 10 to 8 (typedcaptured<T>removed casts)Limits, stated and not coded:
ctx.session.instructions) is not probed or wired. The V2 adapter exposes no system hook.cli/docsandaidd_docs/memory/internal/clido not exist onorigin/next, so the only docs are the bridge doc comments and the fixture README.docs/COMPATIBILITY.mdis untouched.🔗 Linked issue
Refs #1348
✅ I certify
🤖 Generated with Claude Code