Skip to content

cognichem-client 1.1.0: full /api/v1 coverage (workflows, artifacts, lookups, chat) - #3

Merged
tjkessler merged 1 commit into
mainfrom
claude/cognichem-client-python-updates-62db9f
Sep 29, 2026
Merged

tjkessler merged 1 commit into
mainfrom
claude/cognichem-client-python-updates-62db9f

Conversation

@tjkessler

Copy link
Copy Markdown
Member

Summary

Brings the SDK up to the current /api/v1, covering the Python-client follow-up Cognitive-Chemistry-Labs/cognichem#269 from the agent platform epic Cognitive-Chemistry-Labs/cognichem#458. Version bumped to 1.1.0; existing 1.0 calls keep working.

New resources (sync + async)

  • client.workflows: validate, estimate, templates / template, node_ports
    • workflows.runs: create, list, get, artifacts, resume, cancel, delete, wait, run (wait also stops on paused)
    • workflows.definitions: CRUD, JSON download, share / unshare, get_shared / fork_shared, versions / get_version / restore_version
  • client.artifacts: list, usage, upload (multipart cognichem_zip / raw_file), get, download (whole zip or one record=), delete; plus an artifact_ref(id, port) helper for $artifact bindings
  • client.events (list, de-duplicating long-poll listen), client.wallet, client.lookup (PubChem, ChEMBL, Open Targets, UniProt, RCSB PDB, properties), client.reference (reference KG)
  • client.chat (JWT only): sessions, messages, turn estimate, SSE stream / collected send, stop, spend cap, proposals approve / reject
  • Gaps in existing resources: jobs.estimate, paginated jobs.list filters, result_artifact_id on status, inference.cancel / utils.cancel, new API key options, health() / ready()
  • Errors: BadRequestError, PaymentRequiredError, GoneError, PayloadTooLargeError, ServerError; retryability; code = problem type slug
  • Catalog constants: 45 submittable job types (was 23), 5 utilities

Fixes

  • API-key submits failed in 1.0: the API returns 400 missing-idempotency-key for API-key mutations without an Idempotency-Key. Mutating calls now generate one per call unless the caller passes one.
  • api_keys.delete raised on the API's 204 response; it now returns None.

Other

  • cognichem_client.types is now a package (same import path).
  • scripts/sync_routes.py checks keys and paths against backend ROUTE_MAP (snapshot moved to scripts/route_map.txt).
  • README, CHANGELOG, and 4 new examples.

Test plan

  • ruff check src tests scripts examples
  • mypy (strict)
  • pytest: 51 passed (respx-mocked, covering new resources, multipart upload, SSE parsing, polling, error mapping)
  • python scripts/sync_routes.py: all 68 backend ROUTE_MAP routes match; all 21 client-only paths verified against staging router decorators
  • Live health() / ready() against production
  • Authenticated smoke test against staging (workflow run, artifact upload, chat turn); not run, no key available

🤖 Generated with Claude Code

Adds workflows (validate, estimate, templates, node ports, runs,
definitions), artifacts (list, usage, upload, manifest, record download),
completion events, wallet, science lookups, the reference KG, and
CogniChem Assistant chat, with sync and async twins. Covers the Python
client follow-up (cognichem#269) from the agent platform epic
(cognichem#458).

Fixes API-key submits, which the API rejects without an Idempotency-Key:
mutating calls now generate one per call. Fixes api_keys.delete raising
on the 204 response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tjkessler
tjkessler merged commit 9ceaaa0 into main Sep 29, 2026
3 checks passed
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