Skip to content

fix(runtime-host): allow archiving stopped agent graphs - #4996

Merged
me2seeks merged 1 commit into
apache:mainfrom
liuxiaocs7:fix/4995-archive-stopped-agent-graphs
Sep 8, 2026
Merged

fix(runtime-host): allow archiving stopped agent graphs#4996
me2seeks merged 1 commit into
apache:mainfrom
liuxiaocs7:fix/4995-archive-stopped-agent-graphs

Conversation

@liuxiaocs7

Copy link
Copy Markdown
Member

Summary

Allow Session retirement when its durable Agent Graph remains open but is quiescent in stopped or failed state.

The Graph's general live-state semantics remain unchanged so stopped graphs can still be recovered or resumed. Retirement now uses a dedicated disposition:

  • absent, empty, or completed: clear
  • stopped or failed: quiescent and eligible for retirement
  • active, waiting, or closing: busy

An active Agent Graph supervisor wake continues to block retirement.

Fixes #4995

Verification

  • npm run build
  • npm run lint
  • npm run format:check
  • npm run typecheck
  • npx knip --workspace apps/desktop
  • npx knip --workspace packages/ui
  • node --test packages/runtime/dist/__tests__/stream-graph-coordinator.test.js (14 passed)
  • node --test packages/runtime-host/dist/__tests__/session-retirement-coordinator.test.js (27 passed)

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex diagnosed the failure, implemented the retirement-state classification and regression tests, and assisted with verification and PR preparation. The commit includes a Generated-by: Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Classify durable Agent Graph state specifically for Session retirement so stopped and failed open graphs can be archived without changing their broader recovery semantics. Keep active, waiting, closing, and supervisor-wake activity fenced as busy.

Generated-by: Codex
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 7, 2026

@me2seeks me2seeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by OpenAI Codex, operated by me2seeks, at 25cf93ed4b1b11397cd18af5d1a6824589364485. This is an automated technical assessment, not an independent human review. Approval is submitted at the operator's explicit direction.

No blocking correctness findings. Traced the fresh durable graph read, complete-model status computation before visible-list truncation, and Session retirement family expansion to every graph operator across epochs. Retirement still holds family admission and checks each root/child Turn, Messages, Interactions, Goals, resources, effects and supervisor wakes. Stopped/failed graphs may retire without changing the broader open-graph recovery semantics. All 41 exact-source coordinator and retirement tests passed locally.

  1. Optimal for the actual problem: Yes; the change addresses the defect at its existing owner.
  2. Production code that can be deleted: Nonblocking P3: clear and quiescent_open are currently consumed identically by the only production retirement caller; the distinction adds no separate action today. The broad live-state API must remain because recovery and epoch selection have different obligations.
  3. Low-quality tests that can be deleted or replaced: None identified.
  4. Deeper refactor: No deeper refactor is needed.
  5. Ready to merge: Content is ready; merge remains conditional on current required checks and conflict state.
  6. Residual risks / verification: 41 tests passed against exact-source bundles after generating model metadata from the pinned repository inputs. No full Host protocol/GUI archive journey was run locally. Changes Session archive/removal eligibility; material lifecycle and user-visible changes require independent human review under CONTRIBUTING.md.

@me2seeks
me2seeks merged commit e60e85d into apache:main Sep 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stopped Agent Graph prevents Session archival

2 participants