Skip to content

Local agent's get_workflow_state guidance doesn't mention degraded_reasons #2838

Closed

Description

@mstomar125

Context

Surfaced during review of PR #2817 (core#2769), which added WorkflowState.degraded_reasons: Vec<String> to get_workflow_state's response — non-empty when a schema/extends-chain resolution call failed and the response was degraded to a narrower field/relationship set. The field's doc comment says a caller "should treat the response as incomplete, not authoritative, until a retry comes back with an empty degraded_reasons."

Problem

The one autonomous consumer of get_workflow_state — the local AI agent's skill guidance (packages/agent/src/skill_pipeline.rs) — was not updated to mention this field. The guidance instructs the agent: "if a condition comes back unresolvable, say so plainly... don't describe it as not yet met." If a response has a non-empty degraded_reasons (e.g. a transient resolve_field_owners/resolve_relationships failure), the agent still confidently tells the user a condition is misauthored — contradicting the field's own documented contract. The contract currently lives only in the Rust struct doc comment and was never propagated to this consumer.

Impact

Low-frequency (only fires on a genuine transient DB error during the query, not the common path), but user-facing when it does: the local agent can assert "this condition is a typo" to a user based on a response that was itself flagged as unreliable.

Suggested approach

Not prescribed — update the get_workflow_state tool guidance in skill_pipeline.rs to mention degraded_reasons and instruct the agent to caveat or retry before asserting an Unresolvable/misauthored verdict when it's non-empty.

Also worth covering in the same pass

Test coverage: none of PR #2817's new tests exercise the degraded_reasons fallback branches themselves (the actual degraded field/relationship set produced, the message content, or that degraded.push is reached at all) — only the happy path plus degraded_reasons.is_empty(). Forcing a real DB-level failure in a unit test isn't straightforward with the current NodeService/SqliteStore setup (no injectable failure seam), which is why this was left as a known gap rather than fixed in that PR. Worth a look alongside this guidance update, or as its own small follow-up if a suitable failure-injection seam doesn't already exist.

Non-goals

No change to WorkflowState's shape or get_workflow_state's degradation mechanism itself (that's PR #2817) — scoped to making the one real consumer aware of the contract it already documents.

Activity

  1. malibio commented on Sep 27, 2026

    @malibio
    Collaborator

    Frontend baseline: 279 files / 5402 tests passed

  2. self-assigned this
    on Sep 27, 2026
  3. added a commit that references this issue on Sep 27, 2026
    ab1575b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions