Add native webhook payload unions and polling helpers#255
Merged
Conversation
Add webhook history examples across SDKs and teach generated webhook payload\ndeserializers to distinguish normal message deliveries from link_shared\nmessage payloads.\n\nUpdate the shared IR/spec plumbing for custom union deserializers and wire the\nGo, C#, Kotlin, Python, Swift, and TypeScript generators to use the composite\nwebhook discriminator without record-key hacks.\n\nValidation:\n- python3 -m py_compile pachca/*.py\n- bun run build\n- bun run examples/webhook-history.ts\n\nCo-authored-by: openai-codex/gpt-5.4 <openai-codex-gpt-5-4@models.pi.local>
Keep literal discriminator fields on generated union member models instead of dropping them during Kotlin and C# union emission. C# now serializes concrete override properties with the JSON field name, while Kotlin keeps secondary literal fields as body properties to avoid changing positional constructor APIs. Also prefer the configured discriminator field when routing union decoding in Go, Python, Swift, and C# so secondary literals like event do not accidentally become the primary discriminator. Regenerated SDK outputs, generator snapshots, and release metadata. Validation: bun --cwd packages/generator test; cd packages/generator && bun run typecheck; SDK compile/build checks for TypeScript, Python, Go, Kotlin, C#, and Swift; real main and webhook-history examples across all six SDKs. Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Add webhook event and payload polling helpers for the generated SDK clients across TypeScript, Go, Python, Kotlin, C#, and Swift. The helpers default to polling from startup time, dedupe delivery IDs in memory, and stop paging once they reach only-old webhook pages. Add polling examples for every SDK. Validation run: TypeScript typecheck, Go generated tests, Python compileall, C# build, Kotlin compileKotlin, and Swift Polling target build. Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Move the SDK webhook polling helpers into the multi-language generator so future SDK regeneration keeps the polling API in sync across TypeScript, Go, Python, Kotlin, C#, and Swift. The generated helpers default to polling from startup time, dedupe delivery IDs in memory, expose payload polling shortcuts, and stop paging once a page contains no recent webhook events. Validation: bun run test and bun run typecheck in packages/generator; SDK compile/typecheck checks were run earlier after regeneration. Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Document the pending SDK and generator releases for webhook payload discriminators and native polling helpers so the changelog sync gate sees package-visible changes. Add the 2026-06-05 product update source entry and regenerate the public update markdown and llms index from the docs generator. Validation: bun run check:changelog. Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Replace the webhook polling guide's manual interval loop with the generated SDK polling helpers and regenerate public markdown artifacts. Expose the polling helper methods in generated TypeScript and Python examples.json so docs code validation recognizes guide snippets using pollWebhookEvents and poll_webhook_events. Validation: apps/docs bun run generate-llms; packages/generator bun run test and bun run typecheck; sdk/typescript bun run typecheck; sdk/python compileall; bun run check:changelog. Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Add SDK example entries for webhook polling helpers across generated languages and use them in the webhook polling guide. Teach ApiCodeExample and the MDX expander to render SDK-only multi-language examples while filtering non-SDK tabs. Commit regenerated markdown and SDK example snapshots so CI generated-sync has no drift. Ignore local .pi/tmp runtime logs so dev-server files are not accidentally staged. Validation: bun turbo check; package generator bun test; SDK language build checks; CI=1 check-generated-sync before commit reproduced only expected uncommitted generated diffs. Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
4948daa to
113bb76
Compare
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
Validation
Notes