feat: sync Python SDK to TypeScript SDK parity#15
Merged
khaliqgant merged 7 commits intomainfrom Mar 28, 2026
Merged
Conversation
Spec: docs/knowledge-extraction-spec.md - Agents attach knowledge annotations to file paths at write time - Path-scoped queries: 'what do we know about packages/billing/**?' - Auto-extraction from diffs (imports, env vars, test frameworks) - Trajectory retrospective mining for lessons/conventions - Relay broker injects relevant knowledge into agent task preambles - Builds on existing FileSemantics.properties model, no new database Workflow: workflows/relayfile-knowledge-extraction.ts - 7 steps, 4 agents (2 Claude architect/reviewer, 2 Codex builders) - Phase 1: D1 storage + API routes + SDK methods - Phase 2: Diff-based auto-extractors - Phase 3: Trajectory integration - Follows NightCTO workflow lessons: granular steps, output-constrained, Codex builders
Added missing types: BulkWriteFile, BulkWriteInput, BulkWriteResponse, ExportFormat, ExportOptions, ExportJsonResponse Added missing client methods: bulk_write(), export_workspace() Added provider abstractions: IntegrationProvider ABC, WebhookInput, compute_canonical_path(), ListProviderFilesOptions, WatchProviderEventsOptions Added composio integration: ComposioProvider class Updated __init__.py exports
Devin review correctly identified that _read_payload was called unconditionally before checking resp.is_success. For binary responses (e.g. export_workspace(format='tar')), this causes UnicodeDecodeError since _read_payload calls response.text which decodes as UTF-8. Fixed in both sync and async _request_response: return resp immediately on success, only call _read_payload for error paths. Matches TypeScript SDK's performRequest which returns on success without reading payload.
d119090 to
8781f58
Compare
khaliqgant
commented
Mar 28, 2026
Member
Author
khaliqgant
left a comment
There was a problem hiding this comment.
Fixed both issues:
- Sync
_request_response(line 292): Moved_read_payloadafterresp.is_successcheck — binary responses now return immediately without UTF-8 decode attempt - Async
_request_response(line 856): Same fix applied
Commit: 8781f58
Thanks Devin, good catches — export_workspace(format='tar') would have crashed on any successful binary export.
Move TypeScript SDK from packages/sdk/ to packages/sdk/typescript/ Move Python SDK from sdk/relayfile-sdk-py/ to packages/sdk/python/ Updated all CI workflows, publish config, and documentation. No functional changes — same packages, same builds, same publish.
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.
What
Brings the Python SDK () to feature parity with the TypeScript SDK.
Added
BulkWriteFile,BulkWriteInput,BulkWriteResponse,ExportFormat,ExportOptions,ExportJsonResponsebulk_write(),export_workspace()(sync + async)IntegrationProvider: Python equivalent of TSprovider.ts—WebhookInput,compute_canonical_path(), abstract base class withingest_webhook(),get_provider_files(),watch_provider_events()composio.pymatching TScomposio.ts—ComposioProviderclass__init__.py: exports all new modulesGenerated by
Agent Relay workflow (
sync-python-sdk.ts) using Claude (analyst/reviewer) + Codex (builders).How to verify
cd sdk/relayfile-sdk-py python -m pytest tests/ -x