Skip to content

feat(error): let DetailedError contribute structured next_actions to error envelopes - #99

Merged
jpage-godaddy merged 3 commits into
mainfrom
feat/error-envelope-next-actions
Aug 24, 2026
Merged

feat(error): let DetailedError contribute structured next_actions to error envelopes#99
jpage-godaddy merged 3 commits into
mainfrom
feat/error-envelope-next-actions

Conversation

@mguerrero3-godaddy

@mguerrero3-godaddy mguerrero3-godaddy commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds DetailedError::error_next_actions() -> Vec (default-empty, mirroring error_fix()) so error envelopes can carry structured, agent-executable next actions instead of only a plain-text fix string.
  • CliCoreError::Detailed now captures these eagerly at wrap time (before the source is erased to dyn Error), and both build_error_envelope and build_detailed_error_envelope thread the value through instead of hardcoding next_actions: Vec::new().

Implements for ticket DEVEX-983

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all-targets

Manual verification

Setup:

# In the cli repo, temporarily override the engine dependency:
cd cli/rust
# Edit Cargo.toml → cli-engine = { features = ["pkce-auth"], path = "../../cli-engine" }
cargo build --release && cp target/release/gddy ~/.local/bin/gddy

Test WITHOUT the fix (baseline):

cd cli-engine && git checkout main
cd cli/rust && cargo build --release && cp target/release/gddy ~/.local/bin/gddy
# <command to reproduce the issue>
# Expected: <describe broken behavior>

Test WITH the fix:

cd cli-engine && git checkout <this-branch>
cd cli/rust && cargo build --release && cp target/release/gddy ~/.local/bin/gddy
# <same command>
# Expected: <describe fixed behavior>

Cleanup:

# Revert cli/rust/Cargo.toml back to:
# cli-engine = { features = ["pkce-auth"], version = "<published-version>" }

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

I'm not sure about this. I think it might be redundant with the fix addition to the envelope that @qcai-godaddy made here: #65

Do you think there are cases where having next actions that are not considered fixes make sense?

@mguerrero3-godaddy

Copy link
Copy Markdown
Collaborator Author

Do you think there are cases where having next actions that are not considered fixes make sense?

Fair question. Digging in, that fix and next_actions aren't structurally the same (single string vs. a list of executable commands with typed params), and next_actions reuses the same mechanism pagination already ships on the success side (middleware.rs). So it's not really duplicating Qi's PR logic.

That said, nothing in this repo populates error_next_actions() today, transport::Error doesn't override it, and my only example is a test I wrote to verify the wiring works, not a real use case.

I'd say it is less "is this redundant with fix" and more if is it worth merging the capability now, ahead of a real consumer needing it, or should we hold it until we have an actual error type that needs more than one structured follow-up?

@jpage-godaddy jpage-godaddy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess it doesn't hurt to allow next actions for errors. I can at least imagine legitimate cases for it.

@jpage-godaddy
jpage-godaddy merged commit 9c8988a into main Aug 24, 2026
3 checks passed
@jpage-godaddy
jpage-godaddy deleted the feat/error-envelope-next-actions branch August 24, 2026 20:02
@github-actions github-actions Bot mentioned this pull request Aug 24, 2026
jpage-godaddy pushed a commit that referenced this pull request Aug 24, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>cli-engine: 0.9.0</summary>

##
[0.9.0](cli-engine-v0.8.7...cli-engine-v0.9.0)
(2026-08-24)


### ⚠ BREAKING CHANGES

* **fs:** default macOS config dir to Application Support
([#100](#100))
* upgrade reqwest to 0.13
([#102](#102))

### Features

* **error:** let DetailedError contribute structured next_actions to
error envelopes ([#99](#99))
([9c8988a](9c8988a))


### Bug Fixes

* **fs:** default macOS config dir to Application Support
([#100](#100))
([a8a2291](a8a2291))


### Build System

* upgrade reqwest to 0.13
([#102](#102))
([3794ab7](3794ab7))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.

2 participants