polygram 0.33.0 → 0.33.2
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/.claude-plugin/plugin.json +1 -1
- package/lib/codex/diagnostics.js +8 -5
- package/lib/codex/runtime-controller.js +115 -5
- package/lib/db/codex-failed-generation.js +490 -0
- package/lib/db/codex-input.js +26 -0
- package/lib/db/codex-reconciliation.js +184 -190
- package/lib/db/codex-retention.js +5 -18
- package/lib/db.js +30 -16
- package/lib/error/classify.js +1 -0
- package/lib/handlers/codex-reconciliation.js +4 -4
- package/lib/handlers/dispatcher.js +4 -1
- package/lib/telegram/display-hint.js +2 -0
- package/package.json +2 -2
- package/polygram.js +10 -2
package/polygram.js
CHANGED
|
@@ -68,6 +68,7 @@ const { createBuildSdkOptions } = require('./lib/sdk/build-options');
|
|
|
68
68
|
const { createSdkCallbacks } = require('./lib/sdk/callbacks');
|
|
69
69
|
const {
|
|
70
70
|
createCodexRuntimeController,
|
|
71
|
+
resolveCodexStartupRecovery,
|
|
71
72
|
} = require('./lib/codex/runtime-controller');
|
|
72
73
|
const {
|
|
73
74
|
buildCodexSpawnContext,
|
|
@@ -3510,6 +3511,12 @@ async function main() {
|
|
|
3510
3511
|
db = dbClient.open(DB_PATH);
|
|
3511
3512
|
console.log(`[db] opened ${DB_PATH}`);
|
|
3512
3513
|
try {
|
|
3514
|
+
const startupRecovery = await resolveCodexStartupRecovery(pidClaim, {
|
|
3515
|
+
claimThrowsOnSurvivingPredecessor:
|
|
3516
|
+
processGuard.CLAIM_PID_FILE_THROWS_ON_SURVIVING_PREDECESSOR === true,
|
|
3517
|
+
persistedLeaseStatus: db.getCodexLease()?.status ?? null,
|
|
3518
|
+
supervisorGraceMs: processGuard.CODEX_SUPERVISOR_GRACE_MS,
|
|
3519
|
+
});
|
|
3513
3520
|
codexRuntimeController = createCodexRuntimeController({
|
|
3514
3521
|
config,
|
|
3515
3522
|
db,
|
|
@@ -3520,6 +3527,7 @@ async function main() {
|
|
|
3520
3527
|
path.join(process.env.HOME || DATA_DIR, '.claude'),
|
|
3521
3528
|
],
|
|
3522
3529
|
logger: console,
|
|
3530
|
+
startupRecovery,
|
|
3523
3531
|
});
|
|
3524
3532
|
} catch (error) {
|
|
3525
3533
|
codexRuntimeController = null;
|
|
@@ -3531,9 +3539,9 @@ async function main() {
|
|
|
3531
3539
|
try {
|
|
3532
3540
|
const codexBoot = codexRuntimeController.initialize();
|
|
3533
3541
|
codexManagerOptions = codexBoot.managerOptions;
|
|
3534
|
-
if (codexBoot.recovery.status
|
|
3542
|
+
if (codexBoot.recovery.status !== 'clear') {
|
|
3535
3543
|
console.warn(
|
|
3536
|
-
`[codex] runtime
|
|
3544
|
+
`[codex] runtime recovery blocked at boot (${codexBoot.recovery.reason || 'unknown'})`,
|
|
3537
3545
|
);
|
|
3538
3546
|
}
|
|
3539
3547
|
} catch (error) {
|