Repository navigation
feat(forward): add Decision APIs - #26
Merged
Merged
Conversation
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Forward Decision creation, retrieval, and cursor listing so applications can evaluate explicit state or accessible Session history without constructing raw HTTP requests. Creation supports choice and score questions, an
Idempotency-Key, and typed results including refusal answers and context truncation/token-estimate metadata.Why
The deployed Forward API exposes three Decision endpoints that are missing from the SDK. This change follows the service implementation and reuses existing PAT/SAT authentication, transport, errors, and pagination. Exactly one of
stateandsession_idis accepted by the service; model selection remains server-side.Verification
uv run make lintuv run make typecheckuv run make test: 3814 passed; 61 integration cases deselected in the ordinary offline runuv run make docs-checkuv run make buildpython -m examples.forward.decisions --helpLive validation used strict response validation and exercised state and Session creation, boolean false, score zero, string choices, identical-request replay, changed-body 409, retrieval, and both cursor directions. Two async SA verification attempts initially failed because the separate acceptance harness called
closeinstead ofacloseon the credential; both were rerun successfully after correcting the harness. No SDK change was needed. Temporary Session/Template/Identity/Environment resources were cleaned up. Long-history truncation and Identity-scoped SAT isolation were not exercised live.Public entry points:
client.decisions.create,retrieve, andliston Forward and AsyncForward.Impact
UnreleasedinCHANGELOG.md.env.live, live logs, or generated test output committedNo breaking changes or migration steps. Decision records have no delete endpoint and expire under server retention. Live tests require explicit write/execution/Decision gates and stay outside ordinary PR tests. This PR does not bump the package version.