Skip to content

Expose tool/subagent execution metadata to the agent #23421

Closed as not planned
Closed as not planned

Description

@jjangga0214

Summary

OpenCode appears to have session/history/event data, but it does not clearly expose execution metadata for tool calls and subagent runs to the active agent.

This makes it hard for the agent to answer questions like:

  • did the task stop in the middle?
  • is it still running or just slow?
  • when was the last successful activity?
  • did it fail, timeout, or get cancelled?

Why this matters

Today the agent can usually see:

  • tool results
  • success/failure at a high level
  • returned content

But it often cannot reliably see structured metadata such as:

  • start time
  • end time
  • duration
  • last activity time
  • running/completed/timed_out/cancelled state per tool/subagent

That leads to vague answers where the platform may know more internally, but the agent cannot reason over it.

Proposal

Expose minimal execution metadata for:

  • tool calls
  • subagent/task runs

Suggested fields:

  • id
  • kind (tool_call | subagent_run)
  • name
  • status (queued | running | succeeded | failed | cancelled | timed_out)
  • started_at
  • ended_at
  • duration_ms
  • last_activity_at
  • parent_id
  • error_summary

This does not need full raw tracing. A small structured timeline would already be enough for better agent reasoning.

Why agent-visible matters

A UI timeline would be useful, but agent-visible metadata is the more important gap.

If the agent can inspect execution metadata, it can:

  • answer interruption questions precisely
  • decide whether to retry or wait
  • distinguish slow vs stuck
  • explain failures more accurately
  • summarize partial runs without guessing

Notes

This report is intentionally phrased as an exposure/observability gap, not a claim that OpenCode has no internal trace data.

From the public docs, I could verify:

  • session/message/history APIs exist
  • event streaming exists
  • share sync includes conversation history and session metadata
  • a session timeline concept exists in the UI/docs

What I could not find clearly documented was agent-accessible execution metadata for tool/subagent runs.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 19, 2026
  2. github-actions commented on Apr 19, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature request titles must start with [FEATURE]: (e.g. [FEATURE]: Expose tool/subagent execution metadata to the agent)
    • The issue should use the official Feature Request template, which includes a verification checkbox confirming the feature was not found in existing issues/docs

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. github-actions commented on Apr 19, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

  4. jjangga0214 commented on Apr 20, 2026

    @jjangga0214
    Author

    Reopened as #23474 using the required feature request format and title prefix.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions