Commit a1aca29
committed
Switch passive extractor to direct pi-ai model calls
- Replace embedded OpenClaw runner with @mariozechner/pi-ai
The embedded extractor — even isolated in a worker — pulls in
the full agent runtime for a single JSON-only completion. Direct
pi-ai calls give proper abort/timeout semantics natively. Embedded
extraction is retained only for tests; production fails closed if
no direct adapter is available.
- Identify extractor turns by run id / provenance, not just sentinel
Recursive passive jobs were possible whenever OpenClaw surfaced
the extractor's run through runId or inputProvenance instead of
sessionKey. Consolidate detection into isPassiveExtractorEvent()
and apply it across the bridge handler and plugin lifecycle hooks.
- Add PassiveExtractorProviderUnavailableError so the bridge log
distinguishes pi-ai load failures, unsupported providers, and
missing keys from the generic "provider_unavailable".
- Fall back to the configured primary model when no active model ref
was observed on the turn (e.g. plugin instances that never saw
model_call_started).1 parent 68319b0 commit a1aca29
7 files changed
Lines changed: 633 additions & 42 deletions
File tree
- src
- features/bridge
- plugin
- tests/unit
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| 97 | + | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
1121 | 1126 | | |
1122 | 1127 | | |
1123 | 1128 | | |
| 1129 | + | |
| 1130 | + | |
1124 | 1131 | | |
1125 | 1132 | | |
1126 | 1133 | | |
| |||
1207 | 1214 | | |
1208 | 1215 | | |
1209 | 1216 | | |
| 1217 | + | |
1210 | 1218 | | |
1211 | 1219 | | |
1212 | 1220 | | |
| |||
1380 | 1388 | | |
1381 | 1389 | | |
1382 | 1390 | | |
1383 | | - | |
| 1391 | + | |
1384 | 1392 | | |
1385 | 1393 | | |
1386 | 1394 | | |
| |||
0 commit comments