This repository was archived by the owner on Nov 26, 2026. It is now read-only.
Repository navigation
Commit 4186ff3
committed
feat: route OpenCode permission asks to a captain decision
An OpenCode 2 permission ask renders as a modal inside the worker's own
TUI. The captain never sees it and firstmate has no record of it, so a
worker asking for a path outside its worktree simply blocks with no
visible decision anywhere.
bin/fm-opencode-permission.sh bridges one real request to the captain
through the existing Discord decision path and applies the keyed answer
back to exactly that request. The generated OpenCode plugin only forwards
permission.asked and decides nothing: a plugin that approved anything
would be the invisible grant this change exists to remove.
decide refuses unless the record names that exact task and request, is
still pending, carries the task's current busy generation, and the server
still reports it pending with the same id, session, and action. The
read-check-consume sequence is one critical section and the record becomes
consumed before the POST, so a replay or a concurrent second caller
refuses rather than granting twice.
A captured Discord reply now also enqueues its own durable wake. The
stdout contract only reaches a session when the watcher ran the poll, so
an operator-run or LaunchAgent-run ingress poll captured a reply whose
marker then made every later watcher poll suppress it. Capture is now the
wake; the stdout contract is unchanged for the watcher's own dispatch.
answer-one gains an optional occurrence guard, and the reply path passes
it. The decision key already carries the occurrence the captain was
actually asked at, so a reply arriving after a call was answered and
re-held would otherwise resolve the newer question they were never asked.
Every decision answer is then confirmed to the captain, after the keyed
command succeeds. An answer with no receipt is indistinguishable from a
lost reply.1 parent 7a7f754 commit 4186ff3
14 files changed
Lines changed: 1274 additions & 5 deletions
File tree
- .agents/skills/fmx-respond
- bin
- docs
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
152 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
157 | 169 | | |
158 | 170 | | |
159 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
| |||
1933 | 1943 | | |
1934 | 1944 | | |
1935 | 1945 | | |
1936 | | - | |
| 1946 | + | |
1937 | 1947 | | |
1938 | 1948 | | |
1939 | 1949 | | |
1940 | 1950 | | |
| 1951 | + | |
1941 | 1952 | | |
1942 | 1953 | | |
1943 | 1954 | | |
| |||
1946 | 1957 | | |
1947 | 1958 | | |
1948 | 1959 | | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
1949 | 1963 | | |
1950 | 1964 | | |
1951 | 1965 | | |
1952 | 1966 | | |
1953 | 1967 | | |
1954 | 1968 | | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
1955 | 1994 | | |
1956 | 1995 | | |
1957 | 1996 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
| |||
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
0 commit comments