Repository navigation
fix(gjc): settle a Chat-typed skill from the turn its own skill record started - #3097
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Review round on 59db6dc:
|
|
Local merge gate (owner-approved): origin/main merged (no overlap), |
Fixes #1485
Problem
A skill sent from Chat to a gjc pane (
/skill:<name> <args>) stayed "accepted" and then went to "no result seen": the bridge took a gjc send's result only frommodel_change,thinking_level_changeandcompactionrecords, and the issue assumed a TUI-typed run could only be tied to its result through the gjc SDK.What gjc records (checked on real gjc 0.18.12)
Typing
/skill:probe hello thereinto a real gjc 0.18.12 TUI (isolatedHOME, a local fake OpenAI-compatible model) writes, in the session's own JSONL:{"type":"custom_message","customType":"skill-prompt","details":{"name":"probe","path":"…/SKILL.md","args":"hello there",…},"attribution":"user","id":"d83ec743",…}parentIdoff that record, ending in an assistant message whosestopReasonis nottoolUse(hereerror, as the fake model cut its stream).So the TUI path already records the skill run and its turn end in the transcript the bridge reads (#1542's native binding). No SDK broker or SDK turn event is needed.
Change
server/outcome.tsonly:commandTranscriptRecordskeeps askill-promptrecord'stype,id,parentId,timestampanddetails.name/details.args(not the skill's instructions).skill:send uses the same echo reservation Claude's commands use: its echo is theskill-promptrecord whose/skill:<name> <args>equals the sent text, written after the send and inside its window. When more such records appear than pending identical sends (the same skill typed in the terminal too), the send is marked ambiguous and gets no evidence.parentIdbranch whosestopReasonis nottoolUse(stop,error,aborted). If a user message or another skill record joins the turn first, there is no evidence. The outcome becomesresult-observedwith evidence kindtranscript, at that end's time. The HTTP/WS contract does not change.Out of scope:
CommandOutcomehas no done/failed split, so a failed turn shows asresult-observedlike a finished one; the error itself shows in the conversation. pi and omp sends are unchanged.Validation
bun test server/outcome-gjc-skill.test.tson unchanged main: 5 fail (the stop/error/aborted ends, two identical sends, the/api/pane/promptroute), 6 pass (the guard rows). With the change: 11 pass.commandTranscriptRecords+CommandReservations.observeTranscript: the send settles at the turn's end record (2026-11-06T01:14:14.204Z).bun test server/outcome*.test.ts server/gjc*.test.ts server/conversation*.test.ts server/skills/gjc.test.ts: 529 pass, 0 fail.bun run typecheck: pass.bun run check fast: pass (workflow syntax, generated types/themes, typecheck, build, unit 12535 pass / 0 fail). Then rebased on e88044a (one unrelatedsrc/commit) and reranbun test server/outcome*.test.ts: 183 pass./skill:probe print "a b"could take the record of"a b"): real gjc 0.18.12 recordsdetails.argsas'print "a b"'(inner spaces kept, ends trimmed), so the match now keeps inner spaces. New guard row fails before, passes after.bun run check fastagain: pass (unit 12536 pass / 0 fail); real transcript still settles.