Skip to content

💥 feat(sdk): remove usage of anyhow from public error types#1326

Open
chris-olszewski wants to merge 6 commits into
mainfrom
olszewski/remove_anyhow_2
Open

💥 feat(sdk): remove usage of anyhow from public error types#1326
chris-olszewski wants to merge 6 commits into
mainfrom
olszewski/remove_anyhow_2

Conversation

@chris-olszewski

@chris-olszewski chris-olszewski commented Jun 11, 2026

Copy link
Copy Markdown
Member

What was changed

  • Switch ApplicationFailure to be backed by boxed errors
  • Switch WorkflowError to be backed by boxed errors
  • WorkflowContext::force_task_fail now works with boxed errors instead of anyhow
  • Added helper for constructing a WorkflowTermination from ApplicationFailure (allows ? to work well in workflow code)
  • Cleaned up some examples/tests that still had extra anyhow wrapping

These are technically breaking changes, but most code should continue to work without issue as anyhow::Error implements Into<Box<dyn Error + Send + Sync>>

Each commit is reviewable on its own.

Why?

Reduce our usage of anyhow in public facing APIs

Checklist

  1. Closes N/A

  2. How was this tested:
    Existing tests

  3. Any docs updates needed?
    Once released we can update docs to no longer have ApplicationFailure::new(anyhow!("boom"))

@chris-olszewski chris-olszewski marked this pull request as ready for review June 11, 2026 22:44
@chris-olszewski chris-olszewski requested a review from a team as a code owner June 11, 2026 22:44

@Sushisource Sushisource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Niiiice!

Maybe update agents.md and/or the readme with info that we shouldn't depend on anyhow in public API of the SDK?

@github-actions

Copy link
Copy Markdown

Opengrep — new findings

Severity Location Rule Message
ERROR crates/protos/protos/api_upstream/.github/workflows/create-release.yml:25 security.gha.missing-explicit-permissions-temporal No explicit GITHUB_TOKEN permissions found at the workflow or job level. Add a permissions: block at the workflow root (applies to all jobs) or per job with least privilege (e.g., contents: read and only specific writes like pull-requests: write if needed).
ERROR crates/protos/protos/api_upstream/.github/workflows/create-release.yml:30 security.gha.missing-explicit-permissions-temporal No explicit GITHUB_TOKEN permissions found at the workflow or job level. Add a permissions: block at the workflow root (applies to all jobs) or per job with least privilege (e.g., contents: read and only specific writes like pull-requests: write if needed).
ERROR crates/protos/protos/api_upstream/.github/workflows/create-release.yml:99 security.gha.missing-explicit-permissions-temporal No explicit GITHUB_TOKEN permissions found at the workflow or job level. Add a permissions: block at the workflow root (applies to all jobs) or per job with least privilege (e.g., contents: read and only specific writes like pull-requests: write if needed).
ERROR crates/protos/protos/api_upstream/.github/workflows/trigger-api-go-update.yml:16 security.gha.missing-explicit-permissions-temporal No explicit GITHUB_TOKEN permissions found at the workflow or job level. Add a permissions: block at the workflow root (applies to all jobs) or per job with least privilege (e.g., contents: read and only specific writes like pull-requests: write if needed).

Suppress findings

Add a noopengrep comment on the line before the finding:

# noopengrep: <rule-id>

@chris-olszewski chris-olszewski force-pushed the olszewski/remove_anyhow_2 branch from b817a7e to 1550e29 Compare June 12, 2026 14:06
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.

2 participants