@monotykamary/pi-retry 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/package.json +2 -1
- package/retry.ts +311 -90
- package/src/child-retry.ts +573 -0
- package/src/config.ts +323 -13
- package/src/retry-logic.ts +14 -0
- package/src/session-registry.ts +240 -0
package/README.md
CHANGED
|
@@ -341,3 +341,50 @@ pi install npm:@georgebashi/pi-retry
|
|
|
341
341
|
## License
|
|
342
342
|
|
|
343
343
|
MIT
|
|
344
|
+
|
|
345
|
+
## Subagent retry policies
|
|
346
|
+
|
|
347
|
+
Sessions that should retry with a different policy can be selected by matching
|
|
348
|
+
their effective system prompt. This is user configuration: the extension ships
|
|
349
|
+
no built-in marker or identity check for any specific subagent tool.
|
|
350
|
+
|
|
351
|
+
```json
|
|
352
|
+
{
|
|
353
|
+
"piRetry": {
|
|
354
|
+
"subagents": {
|
|
355
|
+
"enabled": true,
|
|
356
|
+
"match": {
|
|
357
|
+
"systemPromptRegex": [
|
|
358
|
+
{
|
|
359
|
+
"pattern": "^<active_agent name=\"[^\"\\r\\n]+\"/>$",
|
|
360
|
+
"flags": "m"
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
"baseDelayMs": 1000,
|
|
365
|
+
"maxDelayMs": 10000,
|
|
366
|
+
"maxRetriesAtMaxDelay": 2
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Semantics:
|
|
373
|
+
|
|
374
|
+
- Sessions whose effective system prompt matches any listed rule use the
|
|
375
|
+
inline child policy; rules combine with OR.
|
|
376
|
+
- Omitted child fields inherit from the effective top-level policy, field by
|
|
377
|
+
field. Project matcher lists replace global ones.
|
|
378
|
+
- A matching rule with `enabled: false` leaves pi's native retry scheduler
|
|
379
|
+
untouched; a missing, empty, malformed, or nonmatching configuration keeps
|
|
380
|
+
the ordinary `pi-retry` takeover.
|
|
381
|
+
- Patterns are compiled when settings resolve. Invalid syntax, unsupported or
|
|
382
|
+
duplicate flags, and malformed groups warn and become no-match instead of
|
|
383
|
+
matching everything.
|
|
384
|
+
- The extension must also be loaded in the target session (for pi-subagents
|
|
385
|
+
that means listing it in the child's `subagentOnlyExtensions`), not only in
|
|
386
|
+
the parent.
|
|
387
|
+
|
|
388
|
+
The example pattern above matches the `<active_agent name="…"/>` line that
|
|
389
|
+
`pi-subagents` prefixes to native child system prompts; substitute your own
|
|
390
|
+
marker if you select child sessions differently.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monotykamary/pi-retry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Extension suite for pi coding agent that handles 400/413 errors and connection errors with automatic retry",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Tom X Nguyen",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@earendil-works/pi-tui": "*"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
+
"@earendil-works/pi-ai": "0.85.1",
|
|
48
49
|
"@earendil-works/pi-agent-core": "0.85.1",
|
|
49
50
|
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
50
51
|
"@earendil-works/pi-tui": "0.85.1",
|