feat(types): add CxOne stubs so conv.cxone resolves in projects - #296
Open
JaySonani wants to merge 1 commit into
Open
feat(types): add CxOne stubs so conv.cxone resolves in projects#296JaySonani wants to merge 1 commit into
JaySonani wants to merge 1 commit into
Conversation
Companion to genai_lambda_runtime#116, which adds conv.cxone for NICE CXone Signal API handoffs. Without these stubs conv.cxone doesn't exist in _gen and builders get no autocomplete for it. Scoped deliberately to the CXone delta rather than a full resync. A full `sync_runtime_stubs.py` run currently also regenerates conversation.py with imports of clock, knowledge_base and verified_context -- none of which are in STUB_FILES, so none of which get generated. The resulting _gen package fails to import, which would break every project. That is a pre-existing gap, not one to fix in a CXone change. Note cxone.py deliberately does not import Conversation, not even under TYPE_CHECKING: the generator promotes TYPE_CHECKING imports to unconditional ones, and conversation.py imports CxOne, so the pair would be circular and _gen unimportable. flow.py gets away with the same pattern only because nothing imports flow back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage Report
|
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
Companion to genai_lambda_runtime#116, which adds
conv.cxonefor NICE CXone Signal API handoffs. Without these stubsconv.cxonedoesn't exist in_gen, so builders get no autocomplete and a project function that catchesCxOneSignalErrorfails its local tests.Adds
cxone.pytoSTUB_FILES, the generatedsrc/poly/types/cxone.py, and thecxoneproperty on theConversationstub.Deliberately not a full resync
Scoped to the CXone delta rather than running
sync_runtime_stubs.pywholesale, because a full resync is currently broken:STUB_FILESis missingclock.py,knowledge_base.pyandverified_context.py, but the current runtimeconversation.pyimports all three. A full run therefore emits aconversation.pystub importing three modules that never get generated — the resulting_genpackage raisesModuleNotFoundErroron import, which would break every project. That's pre-existing and worth fixing, but not in a CXone change. Happy to raise it separately.(A full run also picks up genuine additive drift that's accumulated since the last sync —
AgenticDial.unsubscribe_from_destination,XaiVoice/GradiumVoice,BackgroundTrack,Attachment.chart_spec,EntityValidationResult.details, newprompt_llmmodels. All safe, all missing from the committed stubs, all better handled in a dedicated resync PR once the three missing modules are added.)Circular-import note
runtime/cxone.pydeliberately does not importConversation, not even underTYPE_CHECKING. The generator promotesTYPE_CHECKINGimports to unconditional ones, andconversation.pyimportsCxOne, so the pair would be circular and_genunimportable.flow.pyuses the same annotate-against-Conversationpattern safely only because nothing importsflowback. There's a comment on the runtime side so nobody re-adds it.Testing
1352 passed, 112 subtests passedruff check/ruff format --checkcleanTicket
https://poly-ai.atlassian.net/browse/HSP-16548
🤖 Generated with Claude Code