Skip to content

Commit edf2a28

Browse files
authored
Fix agent termination cleanup and Codex slash command UX (#24)
1 parent 59983c3 commit edf2a28

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
**Claude** (primary focus) and **Codex** supported out of the box.
2323
Other terminal-based agents work too - `codemob cd` drops you into the workspace.
2424

25+
> Codex integration works but has rough edges around in-session slash commands (`/mob-new`, `/mob-switch`, etc.). Workspace creation, switching, and lifecycle management from the terminal all work fine. Improving this is a high priority.
26+
2527
</details>
2628

2729
## How

cmd/root.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ func spawnAgent(root, binPath string, args []string, workdir string) error {
10931093
if _, err := os.Stat(queuePath); err == nil {
10941094
mobStatus("Stopping agent...")
10951095
if cmd.Process != nil {
1096-
cmd.Process.Signal(syscall.SIGTERM)
1096+
cmd.Process.Signal(syscall.SIGINT)
10971097
}
10981098
return
10991099
}
@@ -1107,6 +1107,12 @@ func spawnAgent(root, binPath string, args []string, workdir string) error {
11071107
err := cmd.Wait()
11081108
signal.Stop(sigCh)
11091109
close(done)
1110+
1111+
// Drain kitty keyboard protocol stack in case the agent exited without
1112+
// popping it (e.g. SIGTERM during queue-based switching). This is a no-op
1113+
// if the protocol was never pushed.
1114+
fmt.Fprint(os.Stdout, "\033[<10u")
1115+
11101116
return err
11111117
}
11121118

internal/mob/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const triggerGuard = `MUST HAVE "mob"/"codemob" in user message. `
3030

3131
// Layer 2 (bodyGuard): prepended to the skill body (loaded after invocation).
3232
// If the agent invokes despite layer 1, this instruction tells it to abort.
33-
const bodyGuard = `STOP. Re-read the user's message. If it does not literally contain the word "mob" or "codemob", do NOT proceed. Instead, apologize for the false match and ask what they meant.
33+
const bodyGuard = `STOP. Re-read the user's message that TRIGGERED this command. If that original message does not literally contain the word "mob" or "codemob", do NOT proceed. Instead, apologize for the false match and ask what they meant. This check applies ONLY to the triggering message - follow-up replies (like "y", "yes", a name, etc.) do not need to contain "mob"/"codemob".
3434
3535
`
3636

0 commit comments

Comments
 (0)