Commit 58acca6
committed
fix(sidebar): KbWatcher onCreated hardcoded setupDone=true — pill flipped to ready on Enable
Root cause survived the previous isAxmeInitialized fix: that function
was only used at activate time. The kb-watcher's onCreated callback
(fires when .axme-code/ first appears) bypassed it entirely:
this.push({ setupDone: true, ... }) // unconditional
So when Enable semantic search ran 'axme-code config set context.mode
search', the CLI created .axme-code/config.yaml as side effect → root
watcher detected .axme-code/ creation → onCreated fired → pushed
setupDone=true blindly. Pill flipped to 'ready' even though no oracle,
no decisions, no memories existed.
Fix: every code path that pushes setupDone now reads via
isAxmeInitialized(workspaceRoot). Four sites updated:
- KbWatcher onChange (poll) — recompute setupDone every tick so when
the agent's first save creates oracle, pill flips immediately
- KbWatcher onCreated — replaced hardcode with isAxmeInitialized()
- refreshAll() — also pushes setupDone
- resolveWebviewView initial push — re-reads instead of trusting
initialState (which can be stale by the time webview resolves)
Exported isAxmeInitialized to accept optional path so sidebar's bound
workspaceRoot is canonical (was reading the global workspaceFolders[0]).
Walkthrough context key axme.workspaceInitialized uses same signal —
fixes Step 2 auto-completing on Enable side-effects.1 parent 3bacaa1 commit 58acca6
2 files changed
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| 130 | + | |
125 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
126 | 137 | | |
127 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
128 | 147 | | |
129 | | - | |
| 148 | + | |
130 | 149 | | |
131 | 150 | | |
132 | 151 | | |
133 | 152 | | |
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
137 | | - | |
| 156 | + | |
138 | 157 | | |
139 | | - | |
| 158 | + | |
140 | 159 | | |
141 | 160 | | |
142 | 161 | | |
| |||
173 | 192 | | |
174 | 193 | | |
175 | 194 | | |
| 195 | + | |
176 | 196 | | |
177 | 197 | | |
178 | 198 | | |
| |||
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
197 | 223 | | |
198 | 224 | | |
199 | 225 | | |
200 | 226 | | |
201 | 227 | | |
202 | 228 | | |
203 | 229 | | |
| 230 | + | |
204 | 231 | | |
205 | 232 | | |
206 | 233 | | |
| |||
0 commit comments