Repository navigation
Accept max_turns stops and open server enumerations - #13
Merged
Merged
Conversation
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
The API now ends a session at
max_turns:/nextreturnsaction: "stop"withstop_reason: "max_turns_reached", an emptycandidateslist and a nulldecision_id; the session becomesstoppedand later/nextcalls return the same stop.max_turns_reachedis no longer a selection warning. Pythonzelinqa1.0.0 declaresStopReason = Literal["no_question_available"]and rejects that response with a validation error.max_turns_reachedstop (theDecisionApresMaxTurnsexample is now a stop,ArretSansQuestionno longer carriesmax_turns_reached).StopReasonisLiteral["no_question_available", "max_turns_reached"] | str. Every enumeration emitted only by the server (SelectionWarning,DegradedReason,SessionStatus, progress, target, override view, audit, compilation, configuration issue and error codes) follows the same open pattern, so a value added by a later API release is returned as a plain string. Enumerations a client sends (QuestionType,QuestionOutcome,CompletionRole,QualificationLevel,ObjectiveOverrideValue,QuestionSelectionMode,QuestionSource,Role,FeedbackResult,ChangeOperation,DimensionSelectionMode) andNextActionstay closed, so request validation is unchanged.max_turns; no text presentsmax_turns_reachedas a warning.typescript/src/generated/openapi.d.tsis regenerated withpnpm generate:types(no hand edits; CI checks it against the snapshot).StopReasongainsmax_turns_reachedandSelectionWarningloses it. No runtime change.check-versionsrequires them to match) and inuv.lock; CHANGELOG entry added and the 1.0.0 heading dated with its publication day.Validation
max_turns_reachedstop parsed from the contract example (blocking and async handles, pending decision cleared, repeated call returns the same stop); unknownstop_reason, warning, degraded reason and statuses accepted;NextActionand every client-sent enumeration still reject unknown values; each named enumeration lists exactly the contract values.uv buildandtwine checkpassed; the 1.0.1 wheel installed in a clean environment parses amax_turns_reachedstop.pnpm generate:typesreproduces the committed declarations;pnpm check(lint, typecheck, 133 tests, version check) andpnpm buildpassed.Release
Both publication workflows are manual (
workflow_dispatch), run only frommain, and wait for approval on their protected environment. Nothing is published by this PR; no tag or release is required.zelinqa1.0.1:gh workflow run publish-python-sdk.yml --ref main -f confirm=publish-zelinqa, approve thepypienvironment, then verifyzelinqa==1.0.1in a clean environment.@zelinqa/sdk1.0.1 withgh workflow run publish-typescript-sdk.yml --ref main -f confirm=publish-zelinqa-sdk(types only).zelinqa>=1.0.1.Clients on
zelinqa1.0.0 fail when the API returns themax_turns_reachedstop, so 1.0.1 should be available on PyPI before that behavior reaches the public API.