Files
glassMxrph-plugins/mx-quickfix/README.md
T
mxandClaude Opus 5.5 94530d3bd3 Quick Fix: reopen after a restart only when its own rebuild caused it
The chat reopened on every shell start while a stale "unseen" result was
left over. Now the helper checks the job's unit for a running rebuild
(zcli, nixos-rebuild, nh, home-manager) and only then reopens; other
restarts keep following a running job quietly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 01:09:35 +01:00

66 lines
2.9 KiB
Markdown

# Quick Fix
A bar button that opens a small chat. Type a quick fix ("install Heroic
Launcher", "make Discord open floating", "the clock is off by one pixel") and a
coding agent does it on its own and answers in a line: "OK: Installed Heroic
Launcher." It cannot ask questions, so keep requests small and clear.
Agents: Claude Code (`claude`), Codex (`codex`), or a local OpenAI-compatible
model (Ollama, llama.cpp, LM Studio) through OpenCode (`opencode`). **Auto**
picks Claude or GPT by the usage left on each subscription, read from
[ai-usagebar](https://github.com/akitaonrails/ai-usagebar) (the tighter of the
session and weekly windows counts), then a local model if one is running.
## How it works
- Each request runs in its own systemd user unit
(`glassmxrph-quickfix-<id>`), so a rebuild that restarts the shell does not
stop it. When the job's own rebuild (`zcli`, `nixos-rebuild`, `nh`,
`home-manager`) restarts the shell, the chat opens again by itself (without
taking the keyboard until you point at it) and shows how it went. Other
restarts leave it closed; a job still running is followed and announced
when it finishes.
- Closing the chat and opening it again starts fresh. Earlier conversations
are under History; opening one continues it. A follow-up resumes the same
agent session.
- If the chat is closed when a job ends, you get a notification.
- Before each run the folders under **Repositories to snapshot** are
snapshotted (only files that differ from the last commit are copied). Undo
puts changed files back, removes new ones, reverts the run's commits and
pushes the revert, then runs **Apply after Undo**. It refuses, touching
nothing, when a file was edited again since.
- The rules the agent follows live in
`~/.config/glassMxrph/quickfix/AGENTS.md` (created on first use): where your
configuration is, how to apply changes, what may be committed. Every agent
gets them, plus a short protocol asking for a one-line `OK:`/`FAILED:` reply.
## Permissions
The agents run without anyone to approve them:
- Claude Code runs in `auto` permission mode (its classifier blocks risky
actions), with **Always allowed** rules on top and a deny list for
destructive commands (`git reset --hard`, `git clean`, force pushes, `rm -rf
/`, garbage collection, reboots, …).
- Codex runs in the workspace-write sandbox with network access; approval
requests go to its automatic reviewer.
- OpenCode runs with `--auto` and the same deny list.
None of this is a sandbox. Only use it on a machine and with rules you trust
it with.
## IPC
```sh
quickshell ipc --path <shell> call quickfix toggle
quickshell ipc --path <shell> call quickfix send "install btop"
quickshell ipc --path <shell> call quickfix undo
quickshell ipc --path <shell> call quickfix status
```
With glassMxrph: `glassmxrph plugin toggle mx-quickfix`.
## Tests
`python3 tests/quickfix_test.py`