@sagentlab/navarch-runtime 0.1.63 → 0.1.64
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/session.cjs +9 -38
- package/package.json +1 -1
package/dist/session.cjs
CHANGED
|
@@ -94,7 +94,7 @@ async function runSession(deps, claimed, sessionId) {
|
|
|
94
94
|
await api
|
|
95
95
|
.completeLease(leaseId, {
|
|
96
96
|
status: "failed",
|
|
97
|
-
report:
|
|
97
|
+
report: failureSummary,
|
|
98
98
|
failure_summary: failureSummary,
|
|
99
99
|
failed_before_start: true,
|
|
100
100
|
evidence_urls: [],
|
|
@@ -174,7 +174,7 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
174
174
|
const failureSummary = `Project ${task.project_id} has no GitHub repository URL. Set it in Project settings before dispatching work.`;
|
|
175
175
|
await api.completeLease(leaseId, {
|
|
176
176
|
status: "failed",
|
|
177
|
-
report:
|
|
177
|
+
report: failureSummary,
|
|
178
178
|
failure_summary: failureSummary,
|
|
179
179
|
failed_before_start: true,
|
|
180
180
|
evidence_urls: [],
|
|
@@ -296,7 +296,7 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
296
296
|
await api
|
|
297
297
|
.completeLease(leaseId, {
|
|
298
298
|
status: "failed",
|
|
299
|
-
report:
|
|
299
|
+
report: "Docker sandbox unavailable on this machine.",
|
|
300
300
|
failure_summary: "Docker sandbox unavailable on this machine.",
|
|
301
301
|
failed_before_start: true,
|
|
302
302
|
evidence_urls: [],
|
|
@@ -634,9 +634,7 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
634
634
|
const redactedReport = (0, redact_cjs_1.redactText)(mapping.reportSummary, knownSecrets);
|
|
635
635
|
const completion = {
|
|
636
636
|
status: mapping.leaseOutcome,
|
|
637
|
-
report:
|
|
638
|
-
? verificationFailureReport(task.task_type, redactedReport, mapping.exitStatus)
|
|
639
|
-
: redactedReport,
|
|
637
|
+
report: redactedReport,
|
|
640
638
|
evidence_urls: mapping.evidenceUrls,
|
|
641
639
|
...(deliveryFailureSummary
|
|
642
640
|
? { failure_summary: (0, redact_cjs_1.redactText)(deliveryFailureSummary, knownSecrets) }
|
|
@@ -698,9 +696,9 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
698
696
|
await api.completeLease(leaseId, {
|
|
699
697
|
...completion,
|
|
700
698
|
status: "failed",
|
|
701
|
-
report:
|
|
699
|
+
report: remediable
|
|
702
700
|
? redactedRejection
|
|
703
|
-
: `${redactedRejection}\n\n---\n\n${completion.report}`,
|
|
701
|
+
: `${redactedRejection}\n\n---\n\n${completion.report}`,
|
|
704
702
|
failure_summary: redactedRejection,
|
|
705
703
|
exit_status: "failed",
|
|
706
704
|
});
|
|
@@ -732,9 +730,9 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
732
730
|
await api
|
|
733
731
|
.completeLease(leaseId, {
|
|
734
732
|
status: "failed",
|
|
735
|
-
report:
|
|
733
|
+
report: lastCompletion
|
|
736
734
|
? `${lastCompletion.report}\n\n---\n\n${failureSummary}`
|
|
737
|
-
: failureSummary,
|
|
735
|
+
: failureSummary,
|
|
738
736
|
failure_summary: failureSummary,
|
|
739
737
|
failed_before_start: !adapterStarted,
|
|
740
738
|
evidence_urls: lastCompletion?.evidence_urls ?? [],
|
|
@@ -815,33 +813,6 @@ function sumReportedUsage(attempts, key) {
|
|
|
815
813
|
});
|
|
816
814
|
return reported.length > 0 ? reported.reduce((sum, value) => sum + value, 0) : undefined;
|
|
817
815
|
}
|
|
818
|
-
/**
|
|
819
|
-
* The control plane refuses to release a verify lease whose failed completion
|
|
820
|
-
* does not open with `Verification verdict: FAIL` or `BLOCKED`
|
|
821
|
-
* (verification_verdict_invalid), and that gate applies to runtime-authored
|
|
822
|
-
* failure reports too. When the report carries no usable verdict — the agent
|
|
823
|
-
* exited non-zero, or opened with PASS despite the failed outcome — label it
|
|
824
|
-
* BLOCKED: the failure prevented an acceptance decision. Without this, the
|
|
825
|
-
* failure completion is itself rejected, the session crashes, and the lease
|
|
826
|
-
* dangles until expiry.
|
|
827
|
-
*
|
|
828
|
-
* A `killed` or `crashed` exit is left unlabelled: the control plane accepts
|
|
829
|
-
* those verdict-less as the runtime's own failure and routes them through
|
|
830
|
-
* failure attribution (an infrastructure retry). A BLOCKED label there would
|
|
831
|
-
* misreport a transient timeout as a verifier verdict and escalate it to a
|
|
832
|
-
* human; the control plane discards such a label, so posting it only muddies
|
|
833
|
-
* the session report.
|
|
834
|
-
*/
|
|
835
|
-
function verificationFailureReport(taskType, report, exitStatus) {
|
|
836
|
-
if (taskType !== "verify")
|
|
837
|
-
return report;
|
|
838
|
-
if (exitStatus === "killed" || exitStatus === "crashed")
|
|
839
|
-
return report;
|
|
840
|
-
const verdict = (0, exit_conditions_cjs_1.leadingVerificationVerdict)(report);
|
|
841
|
-
if (verdict === "fail" || verdict === "blocked")
|
|
842
|
-
return report;
|
|
843
|
-
return `Verification verdict: BLOCKED — the session ended before verification reached an acceptance decision.\n\n${report}`;
|
|
844
|
-
}
|
|
845
816
|
/** Rejection codes another agent turn in the same worktree can plausibly fix. */
|
|
846
817
|
const REMEDIABLE_REJECTION_CODES = new Set([
|
|
847
818
|
"review_fix_required",
|
|
@@ -871,7 +842,7 @@ const REMEDIABLE_REJECTION_CODES = new Set([
|
|
|
871
842
|
// `Verification verdict:` line only has to restate its report; the
|
|
872
843
|
// rejection prose spells out the exact format. Failed outcomes never reach
|
|
873
844
|
// remediation (see the leaseOutcome === "completed" gate) — their reports
|
|
874
|
-
// are
|
|
845
|
+
// are recorded as session failures when the verifier supplied no verdict.
|
|
875
846
|
"verification_verdict_invalid",
|
|
876
847
|
]);
|
|
877
848
|
/**
|
package/package.json
CHANGED