Skip to content

fix(zcode): re-add ZCode support with prompt-unwrap and resume-keep fixes - #1049

Closed
26018gongyuan-boop wants to merge 1 commit into
DietrichGebert:mainfrom
26018gongyuan-boop:fix/zcode-re-support
Closed

26018gongyuan-boop wants to merge 1 commit into
DietrichGebert:mainfrom
26018gongyuan-boop:fix/zcode-re-support

Conversation

@26018gongyuan-boop

Copy link
Copy Markdown

Follow-up to #1040, which dropped ZCode because it could not be tested. ZCode 3.x
has now been debugged end-to-end on Windows with live hook instrumentation; the two
behaviors that made it look broken are fixed and live-verified, so this restores
ZCode as a supported host with those fixes on top.

What was wrong on ZCode

  1. Slash commands arrive as markdown links. ZCode renders /ponytail ultra as
    [$ponytail](<skill path>) ultra in the UserPromptSubmit payload, so the
    tracker's ^[/@$]ponytail match never fired and level switches silently did
    nothing. The tracker now unwraps that form — gated on isZcode, so a
    [ponytail](url) link pasted at the start of an ordinary prompt on Claude
    Code / Codex / other hosts stays silent exactly as before.
  2. A mid-session resume reset just-switched levels. ZCode restarts its runtime
    and resumes the session right after a slash-command prompt, firing
    SessionStart(resume) seconds after the tracker wrote the new level; activate's
    unconditional setMode(getDefaultMode()) then reset it to the default. activate
    now reads the hook payload's source and, on ZCode only (resume/compact), keeps
    the live flag. Other hosts keep their long-standing reset behavior — verified
    byte-identical per host and stdin shape against 552acd5.

Restored from #1040

isZcode detection (ZCODE_APP_VERSION), the strict-JSON output branch (#798), the
ZCode hook test, and the INSTALL.md / docs/agent-portability.md rows.

Notes

…ixes

DietrichGebert#1040 dropped ZCode because it could not be tested. Field debugging on
ZCode 3.x (Windows) found the two behaviors that made it look broken,
both now fixed and live-verified:

- ZCode renders a slash command as a markdown link, so UserPromptSubmit
  prompts arrive as [$ponytail](path) args; the mode tracker now
  unwraps that form. Bare /ponytail, @Ponytail and $ponytail pass
  through unchanged.
- ZCode resumes its runtime right after a slash-command prompt, firing
  SessionStart(resume) that reset a just-switched level to the default
  within seconds; activate now reads the hook payload's source and, on
  ZCode only, keeps the live level across resume/compact. Other hosts
  keep their long-standing reset behavior.

Restores the isZcode detection, the strict-JSON output branch (DietrichGebert#798),
the hook test and the INSTALL/portability rows removed by DietrichGebert#1040.
@DietrichGebert

Copy link
Copy Markdown
Owner

Thanks! I removed ZCode in #1040 because I can't test it myself, and I only keep hosts I can verify.

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.

2 participants