Skip to content

fix: terminal outcome type cycle fails architecture CI - #165284

Merged
shakkernerd merged 1 commit into
mainfrom
fix/terminal-outcome-type-import
Oct 5, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/terminal-outcome-type-import

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

Architecture CI fails because the terminal-error wrapper imports its outcome type through the runtime implementation module. That module loads run-termination, which imports the wrapper and closes a type-inclusive dependency cycle.

Import the same type from its existing leaf owner. The public re-export, error construction, and runtime termination behavior remain unchanged.

Cloud Mac validation passed: the native Madge checker reports zero cycles, core typechecking passes, and all 99 existing terminal-outcome/termination tests pass (18.40 seconds in Vitest, 21.20 seconds including preparation). Focused formatting and type-aware lint also pass.

Fixes #165279.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 10:49 PM ET / October 5, 2026, 02:49 UTC (Revision 2).

ClawSweeper review

What this changes

The PR imports the agent run outcome type from its existing type-only module, breaking a static dependency cycle without changing runtime behavior.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: pinned main and the latest release retain the circular type import. The narrow repair has no identified correctness blocker, consistent with the previous review.

Priority: P2
Reviewed head: 64a8f8589cadaa6fd0c9ad2608a5ea58967d3770

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving repair with relevant reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR changes only the terminal wrapper’s type dependency; ordinary external-contributor runtime proof does not apply. Reported native architecture validation targets the changed contract, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR changes only the terminal wrapper’s type dependency; ordinary external-contributor runtime proof does not apply. Reported native architecture validation targets the changed contract, and no stored-data contract changes.
Evidence reviewed 7 items Verified introduced repair: The pinned introduction changes only the type import in the terminal-error wrapper; error construction and discovery remain unchanged.
Existing authoritative type: The leaf defines AgentRunTerminalOutcome, and the runtime outcome module imports and publicly re-exports that same type. The repair neither duplicates the contract nor changes its identity.
Checker matches reported mechanism: The architecture checker collects static import and export specifiers without excluding type-only imports. The original wrapper-to-outcome edge closes the path through run-termination back to the wrapper; importing the leaf removes that edge.
Findings None None.
Security None None.

How this fits together

The agent runtime carries terminal outcomes through thrown errors so lifecycle consumers preserve timeout and cancellation details. Architecture checks inspect the modules’ import graph, including type-only dependencies.

flowchart LR
  A[Agent run outcome] --> B[Terminal error wrapper]
  C[Leaf outcome type] --> B
  B --> D[Termination classification]
  E[Static module imports] --> F[Architecture cycle check]
  F --> G[CI result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 1 0

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #165279
Summary: This PR is the candidate repair for the linked, still-open architecture-cycle issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep terminal type dependencies directed at the existing leaf contract while preserving the public re-export and runtime termination semantics.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the type-inclusive cycle on pinned main and the architecture checker that detects it. Checks were not executed during this read-only review.

Is this the best way to solve the issue?

Yes, importing the unchanged type from its existing leaf owner is the narrowest repair and preserves runtime behavior and public exports.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d4ce3b2f33d4.

Labels

Label changes:

  • add P2: This repairs a bounded architecture-check failure without evidence of a user-facing runtime outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR changes only the terminal wrapper’s type dependency; ordinary external-contributor runtime proof does not apply. Reported native architecture validation targets the changed contract, and no stored-data contract changes.

Label justifications:

  • P2: This repairs a bounded architecture-check failure without evidence of a user-facing runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR changes only the terminal wrapper’s type dependency; ordinary external-contributor runtime proof does not apply. Reported native architecture validation targets the changed contract, and no stored-data contract changes.

Evidence

What I checked:

  • Verified introduced repair: The pinned introduction changes only the type import in the terminal-error wrapper; error construction and discovery remain unchanged. (src/agents/agent-run-terminal-error.ts:3, 64a8f8589cad)
  • Existing authoritative type: The leaf defines AgentRunTerminalOutcome, and the runtime outcome module imports and publicly re-exports that same type. The repair neither duplicates the contract nor changes its identity. (src/agents/agent-run-terminal-outcome.ts:29, 64a8f8589cad)
  • Checker matches reported mechanism: The architecture checker collects static import and export specifiers without excluding type-only imports. The original wrapper-to-outcome edge closes the path through run-termination back to the wrapper; importing the leaf removes that edge. (scripts/check-madge-import-cycles.ts:25, 64a8f8589cad)
  • Still necessary on main and latest release: Both fetched main and the supplied latest release retain the import from agent-run-terminal-outcome.js. No merged fixing PR is established by the provided context. (src/agents/agent-run-terminal-error.ts:3, d4ce3b2f33d4)
  • Verified three-way merge scope: The test merge records pinned main followed by the exact PR head as parents. Its comparison against main contains only the intended type-import repair; unrelated SQLite base changes are preserved. (src/agents/agent-run-terminal-error.ts:3, 6637622efcb8)
  • Validation and linked implementation request: The captured PR body reports Cloud Mac validation with zero architecture cycles, passing core typechecking, and 99 existing tests passing. Agent terminal outcome type cycle fails architecture CI #165279 describes the same static cycle and explicitly distinguishes it from runtime deadlock. These are reported results, not reviewer-executed checks. (64a8f8589cad)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Mert Başar: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-05T02:44:27.885Z sha 64a8f85 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@shakkernerd shakkernerd self-assigned this Oct 5, 2026
@shakkernerd
shakkernerd merged commit a37950a into main Oct 5, 2026
123 checks passed
@shakkernerd
shakkernerd deleted the fix/terminal-outcome-type-import branch October 5, 2026 02:53
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: agent terminal outcomes no longer create a type dependency cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent terminal outcome type cycle fails architecture CI

1 participant