Skip to content

feat: scope action-attempt error and result accessors by status - #568

Merged
razor-x merged 4 commits into
mainfrom
claude/action-attempt-status-annotations-f216kn
Aug 27, 2026
Merged

feat: scope action-attempt error and result accessors by status#568
razor-x merged 4 commits into
mainfrom
claude/action-attempt-status-annotations-f216kn

Conversation

@razor-x

@razor-x razor-x commented Aug 27, 2026

Copy link
Copy Markdown
Member

What this means for SDK users

error and result on an action attempt now behave and read the way the API actually works — populated only in their status, nil everywhere else:

attempt = seam.locks.lock_door(device_id: device_id, wait_for_action_attempt: false)

attempt.status # => "pending"
attempt.error  # => nil (only present when status is "error")
attempt.result # => nil (only present when status is "success")

The generated docs say so on every accessor:

# @return [Error]
#   Only present when `status` is `error`; `nil` otherwise.

And a failed attempt whose payload is missing the error object now raises a proper error instead of NoMethodError:

seam.locks.lock_door(device_id: device_id)
# => Seam::ActionAttemptFailedError, message "Action attempt failed" when no error object is present

Runtime API behavior is unchanged; per this SDK's dynamic style there is no new class hierarchy — just correct accessors and docs.

How

Bumps @seamapi/blueprint to ^1.10.0, which annotates each action-attempt property with the statuses that populate it. Codegen turns the annotation into a generic available_only_for_statuses :error, ["error"] declaration on the resource (the reader returns nil outside the listed statuses) plus the doc sentence. Nothing is keyed off the names error/result. The old hardcoded ["error", "result"] nullability patch in codegen is removed.

Verification

New specs cover: pending attempts returning nil even when the payload carries data, per-status exposure, the ActionAttemptFailedError fallback (directly and through the resolver), and the generated doc sentences. rake (standardrb + rspec): 236 examples, 0 failures. Regeneration from a clean install reproduces the diff exactly; only lib/seam/resources/action_attempt.rb changed among generated files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EdWS7o3htQ9cNxhCWL5Frp

claude added 4 commits August 27, 2026 01:11
Consume the actionAttemptStatuses property annotation from
@seamapi/blueprint 1.10.0. Properties annotated with statuses are
documented as only present for those statuses, typed as nullable, and
their generated accessors return nil for any other status.

Also guard ActionAttemptFailedError against a failed action attempt
missing its error, falling back to a generic message instead of
raising NoMethodError.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EdWS7o3htQ9cNxhCWL5Frp
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EdWS7o3htQ9cNxhCWL5Frp
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EdWS7o3htQ9cNxhCWL5Frp
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EdWS7o3htQ9cNxhCWL5Frp
@razor-x
razor-x merged commit bccf5ef into main Aug 27, 2026
17 checks passed
@razor-x
razor-x deleted the claude/action-attempt-status-annotations-f216kn branch August 27, 2026 20:50
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