Skip to content

test(client): assert a declined foreign payload is not a commit - #138

Merged
XieX merged 1 commit into
xie/agent-skillsfrom
xie/skills-foreign-not-a-commit
Oct 5, 2026
Merged

XieX merged 1 commit into
xie/agent-skillsfrom
xie/skills-foreign-not-a-commit

Conversation

@XieX

@XieX XieX commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #129, and the Python half of the review comment on launchdarkly/js-ai-sdk#104.

TESTING.md §3.25 says to assert all four shapes that reach payload-transferred with nothing to apply: a none intent, an unrecognised intentCode, a lone transfer with no intent, and a declined foreign payload. test_a_transfer_that_applied_nothing_is_not_a_commit covered three. The foreign case was missing.

Why it matters: if not foreign is dropped from applied and the old basis guard is put back, the full suite still passes, because the foreign-payload tests check only the basis, payloads_ignored and the held set. The outcome would report committed=True, which resets connection_failures and lets a poll keep the etag for content it never applied.

Change:

  • The foreign shape joins the loop. A payload only counts as foreign once a skill payload has committed, so each shape can now run an earlier payload first.
  • The test now checks that the committed set is unchanged and that payloads_transferred went up by one, instead of checking for an empty store and a count of 1.

Verified:

  • The test passes on the current code.
  • With the mutation above it fails.
  • make lint, format-check, typecheck and test all pass (2200 passed).

The matching JS change is pushed to launchdarkly/js-ai-sdk#104.

🤖 Generated with Claude Code


Note

Overview
Extends test_a_transfer_that_applied_nothing_is_not_a_commit so it matches TESTING.md §3.25: the loop now covers all four ways a transfer can finish with nothing applied, including a declined foreign payload (env-flags after a real skill commit).

Each scenario can run an optional prior event sequence (needed so “foreign” only applies once the skill payload is known). Assertions were generalized to committed / up_to_date / basis unchanged, held objects unchanged vs a snapshot, and payloads_transferred increments by one—so a regression that wrongly sets committed=True on ignored transfers would fail even when basis-only tests still pass.

Reviewed by Cursor Bugbot for commit 4f672f6. Bugbot is set up for automated code reviews on this repo. Configure here.

TESTING.md §3.25 asks for all four shapes that reach payload-transferred
with nothing to apply. The test covered three; the declined foreign
payload was missing, so dropping `not foreign` from `applied` still
passed the suite, because the foreign tests assert only the basis. Add
it, priming the reader with a skill commit so the payload is
recognisably foreign, and assert the committed set is unchanged rather
than empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XieX
XieX merged commit e43d9f7 into xie/agent-skills Oct 5, 2026
8 checks passed
@XieX
XieX deleted the xie/skills-foreign-not-a-commit branch October 5, 2026 19:22
@jeffdupont jeffdupont mentioned this pull request Oct 5, 2026
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.

2 participants