Skip to content

feat: sync Python SDK to TypeScript SDK parity#15

Merged
khaliqgant merged 7 commits intomainfrom
feat/python-sdk-sync
Mar 28, 2026
Merged

feat: sync Python SDK to TypeScript SDK parity#15
khaliqgant merged 7 commits intomainfrom
feat/python-sdk-sync

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Mar 28, 2026

What

Brings the Python SDK () to feature parity with the TypeScript SDK.

Added

  • Missing types: BulkWriteFile, BulkWriteInput, BulkWriteResponse, ExportFormat, ExportOptions, ExportJsonResponse
  • Missing client methods: bulk_write(), export_workspace() (sync + async)
  • Abstract IntegrationProvider: Python equivalent of TS provider.tsWebhookInput, compute_canonical_path(), abstract base class with ingest_webhook(), get_provider_files(), watch_provider_events()
  • Composio integration: composio.py matching TS composio.tsComposioProvider class
  • Updated __init__.py: exports all new modules
  • Plugin system workflows: 10 workflow files for SDK plugin interface (001-010)
  • Knowledge extraction workflow

Generated 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

Open with Devin

devin-ai-integration[bot]

This comment was marked as resolved.

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.
@khaliqgant khaliqgant force-pushed the feat/python-sdk-sync branch from d119090 to 8781f58 Compare March 28, 2026 09:37
Copy link
Copy Markdown
Member Author

@khaliqgant khaliqgant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed both issues:

  • Sync _request_response (line 292): Moved _read_payload after resp.is_success check — 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.
@khaliqgant khaliqgant merged commit ea289e2 into main Mar 28, 2026
6 checks passed
@khaliqgant khaliqgant deleted the feat/python-sdk-sync branch March 28, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant