Skip to content

fix(subagents,proactive): unify progression helpers and harden PR #879 race tests - #900

Open
sambitcreate wants to merge 2 commits into
mainfrom
fix/sm-desktop-subagent-proactive
Open

sambitcreate wants to merge 2 commits into
mainfrom
fix/sm-desktop-subagent-proactive

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • Consolidate the 4 subagent progression/identity implementations into renderer/shared/subagent-runs.ts (subagentRunStateProgresses, subagentRunSnapshotProgresses, sameSubagentRunSnapshotIdentity, isSubagentRunStateTerminal), preserving allowStopped: false in main/services/subagents/subagent-control-v2.ts
  • Fix two goal-loop races in main/services/goal/goal-loop.ts (set() cancelling prior watchdog timer; noticeRound() checking goal replacement across awaits before arming relookAfterNotice)
  • Add behavioral matrix and race tests across subagent-runs-v2.test.ts, subagent-control-v2.test.ts, chat-run-input-admission.test.ts, goal-loop.test.ts, keep-awake-core.test.ts, and scheduled-task-triggers.test.ts

Verification

  • npm run type-check
  • Combined 9-file tsx --test suite (275/275 passed)
  • npm --prefix packages/cli run build && npm --prefix packages/cli test (367 passed, 1 skipped)

@pullfrog pullfrog Bot 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.

Important

noticeRound still accepts a stale pre-pause notice after a same-goal pause/resume, so this race should be fixed before merging.

Reviewed changes the shared subagent lifecycle consolidation, goal-loop race fixes, and the added proactive-execution regression coverage.

  • Shared subagent lifecycle centralizes V1/V2 terminal classification, immutable identity, and monotonic progression while preserving the control plane's dedicated stop path.
  • Goal-loop races cancel replacement watchdogs and fence notice-round work against cleared, paused, or replaced goals.
  • Regression coverage expands behavioral tests for input admission, keep-awake state, webhook capacity refunds, and subagent progression matrices.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread main/services/goal/goal-loop.ts Resolved

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes since the prior Pullfrog review at 2ad6f63b9, the follow-up commit closed both reported gaps.

  • Goal revision fence Captured the exact post-dropLook() goal revision and retained it across successful, empty, and rejected fallback-context outcomes.
  • Race regression coverage Added a same-goal pause/resume test that proves stale notices neither start rounds nor arm relooks while preserving current post-dropLook() notices.
  • Keep-awake assertions Replaced the loose error-count check with exact ordered assertions for idle, start, status, and stop failures.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant