@cabane/companion 0.6.104 → 0.6.105
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/dist/cli.js +17 -2
- package/dist/runtime.js +17 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2858,7 +2858,11 @@ function turnFailureCopy(reason, runtime) {
|
|
|
2858
2858
|
var LEASE_REFUSALS = /* @__PURE__ */ new Set([
|
|
2859
2859
|
"dispatch_not_admitted",
|
|
2860
2860
|
"turn_already_ended",
|
|
2861
|
-
"turn_belongs_elsewhere"
|
|
2861
|
+
"turn_belongs_elsewhere",
|
|
2862
|
+
// Rooms: the context this start was composed from named an attempt the
|
|
2863
|
+
// lease no longer picks (midnight rolled it, a degrade retired it). Nothing
|
|
2864
|
+
// was granted; the turn recomposes its context and starts again, once.
|
|
2865
|
+
"dispatch_context_stale"
|
|
2862
2866
|
]);
|
|
2863
2867
|
function apiErrorCode(err) {
|
|
2864
2868
|
if (!(err instanceof ApiError)) return null;
|
|
@@ -9371,6 +9375,8 @@ var TurnExecution = class {
|
|
|
9371
9375
|
// so every exit after this point must settle THE SPAN, not just clear the
|
|
9372
9376
|
// participant flag.
|
|
9373
9377
|
admitted = false;
|
|
9378
|
+
// Rooms: one recompose per turn when the lease refuses a stale context.
|
|
9379
|
+
recomposedForLease = false;
|
|
9374
9380
|
concluded(reason, errorReason) {
|
|
9375
9381
|
return new TurnConcluded(reason, errorReason);
|
|
9376
9382
|
}
|
|
@@ -9689,9 +9695,18 @@ var TurnExecution = class {
|
|
|
9689
9695
|
// and settle moves the cursor to it. Omitted when the server sent
|
|
9690
9696
|
// none (an older API), so the cursor stays where it was.
|
|
9691
9697
|
...this.turnContext.readThrough !== void 0 ? { readThrough: this.turnContext.readThrough } : {},
|
|
9692
|
-
...this.turnContext.readRevision !== void 0 ? { readRevision: this.turnContext.readRevision } : {}
|
|
9698
|
+
...this.turnContext.readRevision !== void 0 ? { readRevision: this.turnContext.readRevision } : {},
|
|
9699
|
+
// Rooms: the attempt this request's session belongs to (null = fresh).
|
|
9700
|
+
...this.turnContext.attemptId !== void 0 ? { attemptId: this.turnContext.attemptId } : {}
|
|
9693
9701
|
});
|
|
9694
9702
|
} catch (err) {
|
|
9703
|
+
if (leaseRefusal(err) === "dispatch_context_stale" && !this.recomposedForLease) {
|
|
9704
|
+
this.recomposedForLease = true;
|
|
9705
|
+
turnLog.info({ turnId }, "dispatcher: lease found the context stale; recomposing");
|
|
9706
|
+
await this.fetchContext();
|
|
9707
|
+
this.buildRequest();
|
|
9708
|
+
return this.acquireLease();
|
|
9709
|
+
}
|
|
9695
9710
|
const refusal = leaseRefusal(err);
|
|
9696
9711
|
if (refusal === "dispatch_not_admitted" || refusal === "turn_already_ended") {
|
|
9697
9712
|
turnLog.debug(
|
package/dist/runtime.js
CHANGED
|
@@ -2192,7 +2192,11 @@ function turnFailureCopy(reason, runtime) {
|
|
|
2192
2192
|
var LEASE_REFUSALS = /* @__PURE__ */ new Set([
|
|
2193
2193
|
"dispatch_not_admitted",
|
|
2194
2194
|
"turn_already_ended",
|
|
2195
|
-
"turn_belongs_elsewhere"
|
|
2195
|
+
"turn_belongs_elsewhere",
|
|
2196
|
+
// Rooms: the context this start was composed from named an attempt the
|
|
2197
|
+
// lease no longer picks (midnight rolled it, a degrade retired it). Nothing
|
|
2198
|
+
// was granted; the turn recomposes its context and starts again, once.
|
|
2199
|
+
"dispatch_context_stale"
|
|
2196
2200
|
]);
|
|
2197
2201
|
function apiErrorCode(err) {
|
|
2198
2202
|
if (!(err instanceof ApiError)) return null;
|
|
@@ -8794,6 +8798,8 @@ var TurnExecution = class {
|
|
|
8794
8798
|
// so every exit after this point must settle THE SPAN, not just clear the
|
|
8795
8799
|
// participant flag.
|
|
8796
8800
|
admitted = false;
|
|
8801
|
+
// Rooms: one recompose per turn when the lease refuses a stale context.
|
|
8802
|
+
recomposedForLease = false;
|
|
8797
8803
|
concluded(reason, errorReason) {
|
|
8798
8804
|
return new TurnConcluded(reason, errorReason);
|
|
8799
8805
|
}
|
|
@@ -9112,9 +9118,18 @@ var TurnExecution = class {
|
|
|
9112
9118
|
// and settle moves the cursor to it. Omitted when the server sent
|
|
9113
9119
|
// none (an older API), so the cursor stays where it was.
|
|
9114
9120
|
...this.turnContext.readThrough !== void 0 ? { readThrough: this.turnContext.readThrough } : {},
|
|
9115
|
-
...this.turnContext.readRevision !== void 0 ? { readRevision: this.turnContext.readRevision } : {}
|
|
9121
|
+
...this.turnContext.readRevision !== void 0 ? { readRevision: this.turnContext.readRevision } : {},
|
|
9122
|
+
// Rooms: the attempt this request's session belongs to (null = fresh).
|
|
9123
|
+
...this.turnContext.attemptId !== void 0 ? { attemptId: this.turnContext.attemptId } : {}
|
|
9116
9124
|
});
|
|
9117
9125
|
} catch (err) {
|
|
9126
|
+
if (leaseRefusal(err) === "dispatch_context_stale" && !this.recomposedForLease) {
|
|
9127
|
+
this.recomposedForLease = true;
|
|
9128
|
+
turnLog.info({ turnId }, "dispatcher: lease found the context stale; recomposing");
|
|
9129
|
+
await this.fetchContext();
|
|
9130
|
+
this.buildRequest();
|
|
9131
|
+
return this.acquireLease();
|
|
9132
|
+
}
|
|
9118
9133
|
const refusal = leaseRefusal(err);
|
|
9119
9134
|
if (refusal === "dispatch_not_admitted" || refusal === "turn_already_ended") {
|
|
9120
9135
|
turnLog.debug(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabane/companion",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.105",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Cabane Companion (headless): connect a coding agent on your machine to your Cabane workspace as a responder — drive work against your own codebase, files, and MCP servers without putting any of it in Cabane.",
|
|
6
6
|
"license": "UNLICENSED",
|