Repository navigation
Description
Summary
.claude/skills/payload-cli/interactive.py exists to answer drizzle's rename-vs-create prompts so migrate:create cannot hang. It no longer answers them: the prompt regex matches plain text, but the child runs on a PTY, so chalk colours the column and table names and the escape codes sit inside the match. The driver reads the prompt, matches nothing, and waits until the caller's timeout kills it — exit 124, no migration, and nothing in the log saying why.
Hit while generating the migration for #706. The workaround was a patched copy run from a scratchpad.
Approach
interactive.py:88:
match = re.search(r'Is (\w+) column in (\w+) table created or renamed', text)What actually arrives on the PTY (/tmp/payload-pty.log):
Is \x1b[1m\x1b[34mcommon_chrome\x1b[39m\x1b[22m column in \x1b[1m\x1b[34msy_atlas_translations_locales\x1b[39m\x1b[22m table created or renamed from another column?
\w+ cannot span the escapes, so the match fails. Starting migration and Accept warnings and push schema to database? still match, because chalk does not colour those — which is why the phase-boundary reset looks like it is working right up to the first real prompt.
Strip the escapes before matching, leaving the raw bytes going to the log untouched:
ANSI = re.compile(r'\x1b\[[0-9;]*[A-Za-z]')
...
text = ANSI.sub('', buf.decode('utf-8', 'replace'))Verified: with that one change the driver answered all 62 prompts for #706's migration and exited 0.
Two things worth doing in the same change:
- Fail loudly instead of hanging. The driver should give up and say so — "saw a prompt I could not parse", with the last 200 characters — rather than let the caller's
timeoutdecide. A silent 124 gives the next reader no clue which of the two documented failure modes they are in. - Update the skill's own record.
SKILL.mdlists "three bugs already fixed in this driver". This is the fourth, and the sentence that files it is the only thing standing between the next person and the same 400-second wait.
interactive.py also resolves the repo root by walking four dirnames from __file__, so a copy cannot be run from elsewhere. An env override (PAYLOAD_PTY_CWD) would make the workaround above unnecessary next time, but that is optional.
Acceptance criteria
- The driver answers a coloured rename-vs-create prompt.
- A prompt it cannot parse ends the run with a non-zero exit and a message naming what it saw, rather than hanging.
-
/tmp/payload-pty.logstill records the raw, coloured output — only the matching copy is stripped. -
.claude/skills/payload-cli/SKILL.mdrecords this as the fourth bug.
Verification checklist
- Make any schema change, then run the driver as documented in
SKILL.mdand confirmgrep -c '\[pty\] answered' /tmp/payload-pty.logis greater than zero and a migration file appears. - Temporarily change the regex to something that cannot match, re-run, and confirm the run exits non-zero within seconds with the unparsed-prompt message.
Notes
Found while implementing #706; the migration there was generated with a patched copy, so #706 is not blocked on this.
⚠ Both files live under .claude/, where Claude Code's Protected Paths guard makes any write need interactive approval. An unattended run does not fail on that prompt — it waits, invisibly. This one has to be done attended.
🤖 Written by the sydevs autonomous loop — see what this is
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
Ardnived commentedon Sep 10, 2026
@sydevs-bot Implement this
sydevs-bot commentedon Sep 10, 2026
🤖 no session running
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
fix(skills): payload-cli's PTY driver stalls — chalk colours break it…