Skip to content

[QUESTION] Go stack filtering can return an empty stack — should it keep the first frame like JS? #346

Description

@debugmcpdev

Surfaced during the #344 review. GoAdapterPolicy.filterStackFrames (packages/shared/src/interfaces/adapter-policy-go.ts) is a plain frames.filter() with no fallback: a goroutine paused entirely inside /runtime/ or /testing/ frames yields an empty get_stack_trace result.

Policies currently disagree on the all-internal edge case:

  • JS: returns [frames[0]] (never empty)
  • Java: returns the full unfiltered array (never hides the stack)
  • Go, .NET: may return []

Docs now describe this accurately (fixed in #344), but the behavioral question stands: an empty stack is a dead end for an agent — it can't tell "no frames" from "all frames filtered", and includeInternals: true is only discoverable if it already knows the filtering exists. Options:

  1. Give Go (and .NET) the JS-style first-frame fallback
  2. Adopt Java's return-everything fallback everywhere
  3. Keep as-is but annotate the empty result (e.g. a note that N internal frames were hidden and how to reveal them)

Option 3 fits the AX principle of replacing what the agent must know with what it can see in the response.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions