Skip to content

test(agent-core-v2): add lifecycle create stub to sessionLegacy status test - #1691

Merged
wbxl2000 merged 1 commit into
mainfrom
fix/agent-core-v2-sessionlegacy-test-stub
Jul 14, 2026
Merged

test(agent-core-v2): add lifecycle create stub to sessionLegacy status test#1691
wbxl2000 merged 1 commit into
mainfrom
fix/agent-core-v2-sessionlegacy-test-stub

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

None — fixes a red main (CI test (4)), problem explained below.

Problem

Since #1625 (d158e0a7a), main's CI fails in agent-core-v2 test/app/sessionLegacy/sessionLegacy.test.ts:

TypeError: session.accessor.get(...).create is not a function
 ❯ ensureMainAgent src/session/agentLifecycle/mainAgent.ts:32
 ❯ SessionLegacyService.resolveMainAgent src/app/sessionLegacy/sessionLegacyService.ts:145

#1625 changed SessionLegacyService.status() to resolve the main agent through ensureMainAgent(), which calls IAgentLifecycleService.create(). The test's hand-rolled lifecycle stub predates that path and only implements whenReady, so the scenario errors before any assertion runs. main's own CI (test (4) shard) has been red since that merge, and every open PR inherits the failure.

What changed

Test-only: add create to the stub, returning the scenario's existing main agent. This matches the real service's create-or-get contract for explicit ids (create joins an in-flight creation and returns an already-created main agent as-is), which is exactly what this session models — a persisted session whose main agent already exists. No implementation code touched; the new status path is the intended behavior.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works (this IS the test fix; full agent-core-v2 suite passes locally).
  • Ran gen-changesets skill, or this PR needs no changeset (test-only change).
  • Ran gen-docs skill, or this PR needs no doc update.

…s test

SessionLegacyService.status() now resolves the main agent through
ensureMainAgent() -> IAgentLifecycleService.create() (since d158e0a),
but the scenario's hand-rolled lifecycle stub only implemented
whenReady, so the test errored with 'create is not a function' before
any assertion ran. Return the existing main agent from create, matching
the real service's create-or-get contract for explicit ids.
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 76ba73e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wbxl2000
wbxl2000 merged commit ed420c9 into main Jul 14, 2026
14 checks passed
@wbxl2000
wbxl2000 deleted the fix/agent-core-v2-sessionlegacy-test-stub branch July 14, 2026 08:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76ba73e05f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +86 to +87
// create is create-or-get for explicit ids: this session's main agent
// already exists, so return it as-is (same as whenReady).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the inline statement comment

packages/agent-core-v2/AGENTS.md requires comments in this package to live only in the top-of-file /** */ block and says to never place them beside statements; this new explanation is inside the agents object. Move the rationale into the existing file header or drop it so the test stays within the package's documented convention.

Useful? React with 👍 / 👎.

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