Skip to content

fix(gjc): settle a Chat-typed skill from the turn its own skill record started - #3097

Merged
devswha merged 3 commits into
mainfrom
fix/gjc-skill-outcome
Nov 6, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/gjc-skill-outcome

Conversation

@devswha

@devswha devswha commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

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 from model_change, thinking_level_change and compaction records, 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 there into a real gjc 0.18.12 TUI (isolated HOME, 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",…}
  • then the turn's messages chained by parentId off that record, ending in an assistant message whose stopReason is not toolUse (here error, 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.ts only:

  • commandTranscriptRecords keeps a skill-prompt record's type, id, parentId, timestamp and details.name/details.args (not the skill's instructions).
  • A gjc skill: send uses the same echo reservation Claude's commands use: its echo is the skill-prompt record 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.
  • Its evidence is the end of the turn that record started: the first assistant message on that record's parentId branch whose stopReason is not toolUse (stop, error, aborted). If a user message or another skill record joins the turn first, there is no evidence. The outcome becomes result-observed with evidence kind transcript, at that end's time. The HTTP/WS contract does not change.

Out of scope: CommandOutcome has no done/failed split, so a failed turn shows as result-observed like a finished one; the error itself shows in the conversation. pi and omp sends are unchanged.

Validation

  • Failing first: bun test server/outcome-gjc-skill.test.ts on unchanged main: 5 fail (the stop/error/aborted ends, two identical sends, the /api/pane/prompt route), 6 pass (the guard rows). With the change: 11 pass.
  • Real gjc 0.18.12 transcript (recorded as above) fed to 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 unrelated src/ commit) and reran bun test server/outcome*.test.ts: 183 pass.
  • Review fix round (Codex MEDIUM, reproduced: inner spaces in a skill's arguments were collapsed, so /skill:probe print "a b" could take the record of "a b"): real gjc 0.18.12 records details.args as '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 fast again: pass (unit 12536 pass / 0 fail); real transcript still settles.
  • Not run: full integration/browser suites (no UI or route change), Windows/macOS.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3904098 and 96efbe7.

Files selected for processing: 3

  • changelog.d/gjc-skill-outcome.md
  • server/outcome-gjc-skill.test.ts
  • server/outcome.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Review round on 59db6dc:

  • omo: CLEAR.
  • Codex (gpt-6.1-terra, xhigh): one MEDIUM, reproduced. A gjc skill send matched its skill-prompt record after collapsing all whitespace, so /skill:probe print "a b" sent from Chat could be credited with a terminal-typed /skill:probe print "a b" run. Fixed in the latest commit: real gjc 0.18.12 records details.args with inner spaces kept and ends trimmed (checked on a live run), so the send and the record now compare the skill name and its arguments exactly, apart from the ends. A guard row in server/outcome-gjc-skill.test.ts covers it (fails before, passes after). No HIGH findings.

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate (owner-approved): origin/main merged (no overlap), bun run check fast passed at this head (12537/0), outcome + gjc tests 258/0, omo CLEAR at this head (Codex Terra xhigh no HIGH on the previous head; its reproduced MEDIUM fixed), threads resolved, merges cleanly. Uses only what gjc 0.18.12 records; no SDK. CodeRabbit was rate-limited. Fixes #1485. Merged without waiting for GitHub CI.

@devswha
devswha merged commit 1e21796 into main Nov 6, 2026
18 of 19 checks passed
@devswha
devswha deleted the fix/gjc-skill-outcome branch November 6, 2026 01:46
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.

gjc: correlate PTY-typed skill runs with SDK turn results

1 participant