Skip to content

[FEATURE]: Add visibility flags for merged config and system prompt #4960

Closed

Description

@mlanza

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I'm working with instruction files and having difficulty understanding what's actually being loaded and processed. While the documentation mentions the merge strategy for configuration files, there's no way to verify the final merged state that the system is using.

There's some challenge in the black box of sending in inputs and observing outputs, even in a deterministic world. Worse with a non-deterministic model processing inputs. I've spent considerable time (see #2225) trying to understand why certain instructions aren't being acted upon, but without visibility into the system prompt or final configuration, it's difficult to reason about the cause.

I put on my functional programming thinking cap (data flowing through a pipeline taking on different forms) to propose these two additions:

  1. --config flag - Display the final merged configuration object as JSON. This would help verify that all configuration sources (global, project-local, etc.) are being combined correctly. Not correctly you, but correctly me.
  2. --system-prompt flag - Show the fully-merged system prompt being passed to the model for a new session. This way I don't have to interrogate it. I know what it will be told.

Having these debugging tools would make it much easier to set up instruction files reliably and understand why the system behaves the way it does. Currently, the lack of visibility makes it difficult to distinguish between configuration issues and model behavior.

Would this be feasible to add?

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 1, 2025
  2. github-actions commented on Dec 1, 2025

    @github-actions
    Contributor

    This appears to be a feature request about debugging and visibility for OpenCode's configuration and system prompts. Searching the repository for related issues...

  3. github-actions commented on Dec 1, 2025

    @github-actions
    Contributor

    Searching repository for related feature requests and issues...

  4. github-actions commented on Dec 1, 2025

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  5. rekram1-node commented on Dec 1, 2025

    @rekram1-node
    Collaborator

    Yeah have a config debug command (opencode debug config), rn it just shows your modifications if you have opencode.json files.

    I think we should adjust it to fully resolve all the different configs so youy have full visibility into everything

  6. mlanza commented on Dec 2, 2025

    @mlanza
    Author

    The --system-prompt flag is really just knowing what you're actually communicating to the model. You have a /thinking toggle in the TUI. Alternately, a /prompting toggle would provide an unfiltered display of what you're actually saying to the model.

  7. will-marella commented on Dec 6, 2025

    @will-marella
    Contributor

    @rekram1-node I've implemented source attribution for debug config - it shows where each value comes from in a _sources object.

    The merge process doesn't track sources, so I retraced config loading to avoid touching core code (~200 LOC). But it might be cleaner to add source tracking directly to the merge logic (~80 LOC).

    Do you think the sources should be displayed by default or behind a --sources flag?

  8. mlanza commented on Jan 15, 2026

    @mlanza
    Author

    I noticed opencode debug config basically does what I suggested in item 1. This was more important than item 2. Closing.

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

    discussionUsed for feature requests, proposals, ideas, etc. Open discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions