Skip to content

feat: workflow_intent Go SDK support#1

Merged
sftimeless merged 9 commits into
mainfrom
feat/workflow-intent
May 13, 2026
Merged

feat: workflow_intent Go SDK support#1
sftimeless merged 9 commits into
mainfrom
feat/workflow-intent

Conversation

@sftimeless

Copy link
Copy Markdown
Member

Summary

  • Adds the Go SDK workflow_intent surface: client.Workflows.Declare/Amend/Complete/Get/List, workflow JSON types, README docs, and a compile-tested examples/workflows sample.
  • Uses Go-native context.Context propagation: WithWorkflow, WorkflowFromContext, and RunInWorkflow, with httpTransport.newRequest auto-injecting X-Keel-Workflow-Id only when the supplied context carries a workflow ID.
  • 8 commits (e8dd0eb types -> 35e093b gofmt). The final gofmt commit is mechanical because origin/main already had formatting drift and the requested gate is gofmt -l . empty.

Highlights

  • Mirrors the workflow declaration response shapes from the API schema, with Go time.Time values for API datetimes and string UUIDs to keep the SDK dependency-free.
  • Adds workflow reason-code sentinels so callers can use errors.Is(err, keel.ErrWorkflowMaxCallsExceeded) while preserving *KeelError / *ThrottledError handling.
  • Locks workflow header behavior with tests: context-scoped requests get the header, requests outside the context do not, goroutines keep the workflow ID when passed the same context, and proxy payloads do not receive the internal workflow header.
  • Adds README usage for the WithWorkflow + HTTP auto-injection pattern and a full declare -> permit calls -> amend -> complete example.

Test plan

  • Baseline origin/main: go test ./... passed before changes (22 top-level test functions)
  • Branch go build ./...: passed
  • Branch go test ./...: passed (32 top-level test functions, 22 -> 32)
  • Branch gofmt -l .: clean
  • Branch go vet ./...: passed

Judgment calls

  • RunInWorkflow accepts func(context.Context) error instead of using ambient global state. This keeps propagation explicit and idiomatic for Go.
  • The SDK exposes WorkflowAmendRequest as requested while targeting POST /v1/workflows/{workflow_id}/amend, matching the workflow design and the JS SDK worktree.
  • The prompt's exact keel-python sdk/python/workflows.py path was not present locally; API schemas, the workflow design doc, and the JS workflow SDK worktree were used as the concrete surface references.

Out of scope

  • Provider SDK middleware patching
  • LangChain Go bindings
  • gRPC variants
  • Streaming workflows

@sftimeless sftimeless merged commit fe66ccc into main May 13, 2026
2 checks passed
@sftimeless sftimeless deleted the feat/workflow-intent branch May 13, 2026 15:29
sftimeless added a commit that referenced this pull request May 21, 2026
…Tier 4 doctrine

Pulls workflow_intent feature (PRs #1, #2, #3) merged on origin/main while
the Tier 4 codegen-first strip was being prepared on codex/tier4-codegen-strip.
Resolves all delete-vs-modify conflicts in favor of the strip:

- Removes apikeys.go, errors.go, http.go, types.go, keel_test.go, and
  provider wrappers (anthropic/google/meta/openai/xai). These were
  hand-maintained ergonomics already removed in the v0.3.0 strip; origin's
  gofmt commit modified them, creating delete-vs-modify conflicts.
- Removes workflows.go, workflow_types.go, workflows_test.go, and
  examples/workflows/main.go. These are the same category of hand-maintained
  helpers Tier 4 doctrine forbids; workflow types now come from the
  generated OpenAPI client.
- Keeps origin's .github/workflows/ci.yml as build/test/fmt/vet CI for
  the generated client. Bumps the Go version source to go.mod (currently
  1.24.3) since the original 1.21/1.22 matrix predated the OpenAPI codegen
  switch. Coexists with the regenerate.yml workflow.
- README.md and keel.go take the Tier 4 versions (Surface position block,
  generated-client framing, regeneration docs).

v0.3.0 was tagged on the partial strip (workflow files were not in local
main at strip time, so they were never deleted from the tree); v0.3.1 is
tagged on this reconciliation as the canonical Tier 4 state. PR history
preserved.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
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