Skip to content

test: add backgrounding scenarios to the session fixtures (#206) - #215

Merged
V3RON merged 13 commits into
mainfrom
issue-206-add-backgrounding-scenarios-to-the-sess
Oct 8, 2026
Merged

V3RON merged 13 commits into
mainfrom
issue-206-add-backgrounding-scenarios-to-the-sess

Conversation

@V3RON

@V3RON V3RON commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Szymon · project thread

Closes #206

What changed

Adds packages/native/fixtures/session-scenarios-background.json with five scenarios, plus the background and foreground drive steps and the suspend wire output. The Swift, Kotlin and Dart suites replay it; the web suite does not, since the web core has no background state.

The Dart suite (packages/flutter/test/core/scenarios_test.dart) now replays the file instead of skipping it. Its runner already had the background, foreground and suspend steps, and the Dart core already behaves as the scenarios require, so no core change was needed. CI's ios and android jobs replay the file on Swift and Kotlin and pass.

Suites that load session-scenarios-background.json: Swift (SessionScenariosTests.swift), Kotlin (SessionScenariosTest.kt), Dart (scenarios_test.dart). The fixtures-conformance suites skip it, like the other scenario file.

Acceptance criteria

# Criterion Test Tier
1 Backgrounding suspends the session, and no reconnect happens while in the background, even after advance passes the backoff cap scenarios "suspends on backgrounding and does not reconnect while in the background, even past the backoff cap" and "sends no connect when backgrounded during a backoff wait, even after the delay passes" (leftover check proves no connect) unit (Swift, Kotlin, Dart)
2 Foregrounding resumes the session at once, without waiting for backoff scenarios "resumes at once on foregrounding, without waiting for backoff" and "does not reconnect when backgrounded during a backoff wait, then resumes at once on foregrounding" unit (Swift, Kotlin, Dart)
3 Backgrounding with a call in flight cancels the call scenario "cancels a call in flight with session_suspended when backgrounded" unit (Swift, Kotlin, Dart)
4 The Swift, Kotlin and Dart suites replay every scenario in the file testReplaysEveryScenarioInSessionScenariosBackgroundJson, replays every scenario in session-scenarios-background json, Dart group session-scenarios-background.json unit (Swift, Kotlin, Dart)
5 Docs: fixtures README lists which suite loads which file packages/native/fixtures/README.md docs

E2E evidence

not applicable (test fixtures and test runners only)

Checklist

  • CHANGELOG.md has an entry under Unreleased (writing-changelog skill), or the change is not user-visible: not user-visible
  • User-facing docs updated for every surface the change touches (writing-user-docs skill), or the change is not user-visible: not user-visible
  • No new import past a module's index.ts; no new direct node:* I/O outside an adapter
  • Simplification checklist from the architecture skill applied, exceptions explained above
  • docs/ARCHITECTURE.md updated if a surface it describes changed: not needed

Out of scope

none

Status

Implement: done Review: done E2E: not applicable Ready: yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4

claude added 7 commits October 7, 2026 20:16
Criteria not yet verified: Gradle cannot run in this environment; CI's android job is the only check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
1 failing (web), Swift and Kotlin predicted red on the drop scenario

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
…205)

Swift and Kotlin sent tool_cancelled on the dead socket; web did not. Web now
reports the state change before the cancel, like the native cores.

1 failing -> 0 failing (web); Swift and Kotlin verified by CI

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
The drop scenario in session-scenarios.json pins the same behaviour
deterministically.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
2 suites failing: the Swift and Kotlin runners do not know the background steps yet

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
2 failing -> 0 failing (unverified locally: no Swift or Android toolchain, CI runs both)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
@V3RON V3RON self-assigned this Oct 8, 2026

@V3RON V3RON left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Request changes (posted as a comment, because GitHub does not let the PR's author request changes): 1 blocker, 1 should-fix, 1 nit. Spec: issue #206 and the #188 design comment.
Fix first: the call-in-flight scenario fails in the ios and android CI jobs, because the fix that stops the cores answering an aborted call is in #214, not on this base. Stack this branch on #214, or rebase it onto main once #214 merges.


Generated by Claude Code

Comment thread packages/native/fixtures/session-scenarios-background.json
Comment thread packages/native/fixtures/session-scenarios-background.json
Comment thread packages/native/fixtures/README.md Outdated
claude added 2 commits October 8, 2026 07:14
…s-to-the-session-f' into issue-206-add-backgrounding-scenarios-to-the-sess
Adds a scenario that ends right after drop, background, advance, so the
leftover check sees any connect. Drops a stray 'only' from the fixtures README.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
@V3RON
V3RON changed the base branch from issue-204-replay-session-scenarios-in-the-kotlin-core to issue-205-add-tool-call-scenarios-to-the-session-f October 8, 2026 07:14
Base automatically changed from issue-205-add-tool-call-scenarios-to-the-session-f to main October 8, 2026 19:09
claude added 2 commits October 8, 2026 19:12
Dart suite now replays session-scenarios-background.json.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4

@V3RON V3RON left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment: 0 blockers, 1 should-fix, 1 nit. Both round-1 findings are fixed, the merge with main is clean, and CI is green on 2238c21.
Spec: issue #206.
Fix first: the stale "Only the Swift and Kotlin suites load it" line in the fixtures README (line 203). The Dart suite replays the file now.


Generated by Claude Code

Comment thread packages/native/fixtures/README.md Outdated
Comment thread packages/native/fixtures/README.md
claude added 2 commits October 8, 2026 19:34
…os (#206)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
… suites (#206)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdGJWmrZxTrqHkodG5oj4
@V3RON
V3RON marked this pull request as ready for review October 8, 2026 19:55
@V3RON
V3RON merged commit d19b9c1 into main Oct 8, 2026
10 checks passed
@V3RON
V3RON deleted the issue-206-add-backgrounding-scenarios-to-the-sess branch October 8, 2026 19:55
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.

Add backgrounding scenarios to the session fixtures

2 participants