Skip to content

Poll activities in their own organization - #38

Merged
figitaki merged 1 commit into
mainfrom
carey/poll-activity-org
Oct 21, 2026
Merged

figitaki merged 1 commit into
mainfrom
carey/poll-activity-org

Conversation

@figitaki

Copy link
Copy Markdown
Contributor

Problem

The client polls an activity until it reaches a terminal status. The poll called get_activity with only the activity ID. Thus the request used the client's default organization.

If you submit an activity with a sub-organization organizationId, the poll queried the parent organization. The poll then failed or returned the wrong result.

Fix

  • The generator adds a _poll_body helper. It builds GetActivityBody with the organizationId of the activity.
  • The client default organization is a fallback. It applies only if the activity has no organizationId.
  • The pending poll and the MFA and consensus polls all use the helper.
  • The client is regenerated with make generate-http.
  • A patch changeset for http is added.

Tests

New offline tests in test_activity_errors.py:

  • Submit create_wallet with a sub-organization ID that is different from the client default. The first response is PENDING. The test checks that the poll body has the sub-organization ID.
  • The same check for the MFA poll (AUTHENTICATORS_NEEDED) and the consensus poll (CONSENSUS_NEEDED).

The new tests fail on main and pass with this change. make format-check and make typecheck pass. The SDK has no async client, so there is no async path to test.

Closes #30

🤖 Generated with Claude Code

The poll helpers called get_activity with only the activity ID, so the
request used the client's default organization. A poll for an activity
submitted to a sub-organization queried the wrong organization.

The poll now sends the organizationId of the activity. It uses the client
default only if the activity has no organizationId. This applies to the
pending poll and to the MFA and consensus polls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@figitaki
figitaki merged commit ad98803 into main Oct 21, 2026
5 checks passed
@figitaki
figitaki deleted the carey/poll-activity-org branch October 21, 2026 18:09
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.

Activity polling uses the client's default organization, so sub-organization activities cannot be polled

2 participants