November 2, 2026
7 pull requests merged across 2 repos
bahdotsh/hopchat
What changed
Drag in the chat or the protocol log to highlight text. Letting go copies it, as in Claude Code.
- A selection stays inside the pane it started in, so the sidebar is never copied.
- The highlight clears on a click, a key, the wheel or a resize.
- Copied text drops trailing spaces, blank rows at the ends, shared indent and the
▎bar beside messages. - Picking a message now happens on mouse release, so a drag doesn't pick one. A plain click behaves as before.
- Local Mac sessions also use
pbcopy, because Terminal.app ignores OSC 52. This fixesyand/methere too. Over SSH, only OSC 52 is used.
Known limitations
- A message that wraps on screen copies with a line break at each wrap.
- Dragging to the edge doesn't scroll, so only what's on screen can be copied.
- A selection marks a screen position, so a new message arriving mid-drag can shift what gets copied.
- The composer, sidebar and pop-up panels have no drag selection. The help screen still explains the Shift or Option route.
Testing
cargo testpasses and clippy reports no warnings.- The real debug binary was run in a pseudo-terminal with raw mouse sequences, and all 31 checks passed.
- Those checks covered exact text, backward drags, pane limits, clearing, click to pick, wrapped messages, the log pane, the real macOS clipboard, SSH behaviour and clean exit.
- Not tried by hand in Terminal.app, iTerm or any other real terminal emulator, or in tmux.
- Up and Down in the composer walk through what you sent in the open conversation, like a shell. Enter sends the recalled line again.
- Each conversation has its own list, so a line can't be resent to the wrong chat. Messages come from stored history; slash commands are kept for the session only.
- Files and automated
@home/@aireplies are left out. Repeated lines collapse, and/clearwipes that conversation's list. - An unsent draft comes back when you press Down past the newest line.
Changed shortcut
Up on an empty line no longer selects a message unless nothing has been sent in that conversation. Selecting moves to Alt-Up; Ctrl-Up and clicking still work. The footer, help screen and README are updated.
Testing
cargo test: 200 passed, 6 ignoredcargo clippy --all-targets: clean- Not tried in a real terminal. Alt-Up on macOS may need Option set to send Meta/Esc+.
Adds two device backends to @home, each in its own commit.
Tuya lights (Wipro and most white-label Wi-Fi bulbs)
- Local control on TCP 6668, protocol 3.3, 3.4 and 3.5. Pairing tries each and keeps the one the bulb answers.
/home tuya IP DEVICE_ID LOCAL_KEYadds a bulb. The key comes once from the Tuya cloud account (Tuya IoT platform or tinytuya's wizard). Nothing reaches the cloud at runtime.- Found by sweeping for port 6668, because many bulbs never broadcast. Plugs and anything else that isn't a dimmable light are refused.
- On/off, brightness, white temperature, colour, status and blink.
Android TV and Google TV sets
- Found over mDNS. Pairing shows a six-character code on the TV, typed with
/home code CODE. A mistyped code is caught before anything is sent. - hopchat makes a certificate per TV and pins the TV's own, as it does for LG.
- Power with Wake-on-LAN, volume level, steps and mute, apps, HDMI inputs and media keys.
- Home Assistant's
androidtv_remoteentities are left out, so a TV isn't listed twice.
Testing
- Tuya: frames and session keys match vectors produced by tinytuya 1.20.0. A stand-in bulb covers every protocol version, a wrong key, a plug, and firmware that wants data points named.
- Android TV: messages match protoc's encoding of the androidtvremote2 0.3.2 schema, and the pairing hash matches the reference formula. A stand-in TV over real TLS covers pairing, certificate pinning, power, volume, apps and refused links.
- On real hardware, with a Xiaomi Mi TV (MZTU0): discovery worked, it paired, and it reported status. It changed volume, and opened YouTube and a video. This testing found two bugs the stand-in missed, both fixed here: the TV rejected a client certificate marked for certificate signing only, and it refused
market://launchapp links. - Not verified on hardware: Tuya control. Two Tuya v3.5 bulbs were found and identified on the LAN, but their local keys weren't available. The live Android TV check is
cargo test scan_for_android_tvs -- --ignored --nocapture, which shows a pairing code on the TV. cargo clippy --all-targets --locked -- -D warningsis clean, andcargo test --lockedpasses 185 tests with 6 ignored.
New dependencies
- Tuya:
aes,aes-gcm,hmacandcrc32fast. - Android TV:
rsaandx509-cert(with thebuilderandhazmatfeatures) andrand_core.sha2gains itsoidfeature. - All are pure Rust and add no system libraries.
num-bigint-digis optimised in dev builds, because RSA key generation is otherwise slow there.
bahdotsh/wrkflw
What
Drag with the mouse in the TUI to highlight text, and it is copied to the clipboard on release, with a status bar confirmation. This supersedes #154, which left selection to the terminal: that selection ran across panes and borders, and copying was a manual step.
- Selection works on the rendered frame, so every tab gets it. A drag stays inside the bordered pane it started in, and what is highlighted is what gets copied.
- Clipboard: text goes out through OSC 52 and through
pbcopy,wl-copy,xcliporxsel. Native tools are skipped over SSH, where they would fill the remote clipboard. - Status message: says "Copied" only when a native tool confirmed it. OSC 52 gives no acknowledgement, so that case says the text was sent to the terminal.
- Wheel: mapped to Up/Down, because capturing the mouse stops the terminal from doing that translation.
- Clearing: a click or any key clears the selection. Esc clears it without quitting.
- Native selection: still available with the terminal's bypass modifier (usually Shift, or Option in iTerm2).
Testing
cargo fmt --check, CI's clippy, check and test commands, plus new unit tests incrates/ui/src/selection.rs.- Drove the real binary under tmux with raw SGR mouse events, using a stub
pbcopy: - Text arrived through the stub and through OSC 52 (tmux buffer).
- Highlight during and after the drag, cleared by a click.
- Esc didn't quit, wheel moved in both directions, mouse mode was off after quitting.
- Selection tried on each tab.
Not tested: a real pbcopy, the Linux tools, or terminal emulators other than tmux.
Known limits
- A drag doesn't auto-scroll at the pane edge, so a copy covers at most what is on screen.
- Double-click word and triple-click line selection aren't included.
- A drag that starts on a horizontal border or panel title isn't inside a pane, so it selects across the whole screen.
Dragging the mouse over the TUI did nothing useful: the text could not be selected, so there was no way to copy a log line or a path out of it without quitting. This PR makes mouse selection and copy work the way they do in Claude Code and most other TUIs.
Cause
run_wrkflw_tui enabled crossterm's EnableMouseCapture at startup, which asks the terminal to send every click and drag to the application instead of handling it itself. The event loop only ever matched Event::Key, so those mouse events were read and dropped. The only observable effect of the capture was that the terminal's native drag-to-select and copy stopped working.
Fix
- Leave mouse capture off. The terminal keeps handling selection, so dragging highlights text and the usual copy shortcut (Cmd+C, Ctrl+Shift+C, …) copies it.
- Drop the matching
DisableMouseCaptureon teardown. - README notes that the TUI does not capture the mouse.
No in-app selection or clipboard code is needed for this: the terminal does the work, which is also how Claude Code behaves.
Testing
cargo fmt --check,cargo clippy -p wrkflw-ui --all-features -- -D warningsandcargo check -p wrkflw-ui --no-default-featuresare clean.cargo test -p wrkflw-ui --all-features: 75 passed, 0 failed.- Drove the old and new binaries in a pseudo-terminal and compared the bytes they write at startup. The old binary emits the mouse-tracking enables (
?1000h,?1002h,?1003h,?1006h); the new one emits none of them and still enters the alternate screen. - Launched the new TUI in tmux: the Workflows tab renders and
qexits cleanly.
Not covered
- Mouse-wheel scrolling never worked (wheel events were captured and dropped) and still doesn't. Terminals that translate wheel to arrow keys in the alternate screen (iTerm2, kitty, WezTerm) now get scrolling for free, since the keys reach the TUI; others don't. Adding real wheel support would mean re-enabling capture and implementing in-app selection with OSC 52 copy, which is a bigger change than this fix.
Testing the agent features from #152 on a small Python repo with a matrix, secrets and path filters showed the failure digest working well, but four problems would mislead an agent or send it the wrong way.
Fixed
- False skip reasons. A README-only PR reported
branch 'main' did not match ["main"]. The reason now names only the filter that rejected. - Missing secrets failed the run.
${{ secrets.X }}failed arun:step here but is empty on GitHub, and was already empty inenv:. It is now empty everywhere, the step output names the secret, andplanlistsmissing_secrets. Provider failures other than "not found" still fail the step. validatemissed real mistakes. New rules:unknown-trigger-filter,unterminated-expression,undefined-step-reference,undefined-need-reference,undefined-matrix-key. Matrices only known at run time are not checked.--eventwas too strict. It now needs a change set only when that event has apaths:filter. MCP gainsno_strict_filterandvariables.
Smaller fixes:
- Matrix legs that failed the same way fold into
also_failed_in, ignoring durations. - Workspace paths in step output are relative.
error_lineskeeps likely causes from above the tail.--from-stepfailures carry anote.- Unnamed
uses:steps report the action. - A missing workflow file is an error, not a recorded run.
- Usage errors are JSON in JSON mode.
Behaviour changes
All are listed in BREAKING_CHANGES.md. The ones to look at: validate can now fail files that passed, a workflow relying on a missing secret failing no longer fails, and code counting failures per matrix leg should read jobs instead.
Testing
cargo test --workspace: 1262 passed, 0 failed. New regression tests cover each fix.cargo fmt --checkis clean.cargo clippy --all-targets -D warningsis clean withclone_on_copyallowed. That lint fails incontinue_on_error_test.rs, which this PR doesn't touch.- The new validate rules raised nothing across 32 workflow files in this repo.
- Replayed the original scenario end to end with emulation, real Docker and an MCP stdio client.
Not covered
- Duration folding only blanks words like
0.01sor12ms. Legs that differ by a timestamp still show separately. - Workspace paths are only made relative in events and stored step logs. TUI and
job.logoutput keep absolute paths. - Missing-secret warnings don't cover composite action steps.
Agents can only scrape colored text from wrkflw today, and that text is gone when the process exits. This PR gives them structured output, a recorded history of runs, and an MCP server.
What's new
--format jsonis a global flag. stdout carries only JSON and logs move to stderr.run,watchandruns replayemit NDJSON events, and other commands emit one document.- Structured validation issues have a rule id, YAML path, line and fix hint. Human messages are unchanged.
- Run history lives in the new
wrkflw-runscrate. Each run stores its record, per-step logs, git state, agent and intent. Commands arewrkflw runs list|show|logs|failure|replay. - Failure digests give the failed step, script, exit code, env exported by earlier steps and output tail. They appear in
run_finished, inruns failure, and on stderr in text mode. wrkflw planreports trigger decisions, job order, matrix legs and steps without executing anything.wrkflw mcp serveprovides 8 tools over stdio. Tools run the wrkflw binary, so they return exactly what the JSON contract promises.- Attribution comes from
--intent,--agent,WRKFLW_AGENTand Claude Code detection. MCP uses the client's name. A new TUI Runs tab shows it. --from-stepresumes a job at a step, andwatch --format jsonstreams cycles and run events.- Agent docs are
AGENTS.md,skills/wrkflwand a Claude Code plugin manifest.
Security fix included
Step output was never masked. Resolved secrets were not registered with the masker, and mask() had no production caller, so secrets printed by a step reached the terminal. Persisting logs would have written them to disk, so this PR fixes it at the source. --variable values are never stored, and run directories are owner-only.
Please review
- Default-on recording. Runs now write to the local data directory, capped at 500.
--no-recordandWRKFLW_NO_HISTORY=1opt out. Logs can still contain secrets wrkflw doesn't recognise. --from-stepsemantics. Each run has a fresh workspace, so earlier outputs and files are missing. Onlyactions/checkoutstill runs.outputis delivered per step. Step output arrives instep_finished, not line by line, because the runtimes capture it. Live chunks would need runtime changes.- Line numbers are best effort.
serde_yamldrops positions, so a text walker finds them. Flow-style YAML reports the parent key's line. - Failure digest env is limited. It lists variables earlier steps exported, with secrets masked, not a full env diff.
- TUI runs are recorded from the job execution path only. The
execute_workflow_clipath in the UI crate is unchanged.
BREAKING_CHANGES.md covers the behaviour changes, including the 7/8 TUI key move.
Testing
cargo test --workspace: 1,220 passed, 0 failed.- New end-to-end tests in
crates/wrkflw/tests/agent_cli_test.rsdrive the real binary. They parse stdout strictly and cover history, secret masking, replay, retention, plan, watch and a full MCP session. - Ran a failing workflow through real Docker. Exit codes, digest and history were correct.
- The Kubernetes runtime was not exercised with these changes.
agent_cli_test.rsis Unix-only because its fixtures use POSIX shell. Windows CI builds and runs the rest of the suite.- On Windows, run files use the data directory's default permissions, and a crashed run stays
runninginstead of becominginterrupted.