Skip to content

interactive conversation with an agent #3222

Closed

Description

@ferrao

I am trying to have an interactive conversation with an agent, which is triggered by a custom command, in a way that this agent's work is only done upon the user confirming so, something like:

[PLAN AGENT]
USER: /research "some topic"

[RESEARCHER AGENT]:

AGENT: Let me ask you some questions...
AGENT: Question 1
AGENT: Question 2
AGENT: Question 3
USER: Answer1
USER: Answer2
USER: Answer3
AGENT: Outputs result of research
AGENT: Are you satisfied with the results?
USER: Yes
AGENT: writes to file and terminates.

[PLAN AGENT]

But after issuing the first question, all remaining interactions fall back to the default PLAN agent.
Am I trying to do something that is not supported, or is there a way to make this flow work?

Activity

  1. github-actions commented on Oct 16, 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.

  2. rekram1-node commented on Oct 16, 2025

    @rekram1-node
    Collaborator

    @ferrao is this specifically with a subagent? Currently you can't talk to subagents which imo is a poor ux and we should fix

    is this specifically with a subagent

    If so I will close and link the other issue that tracks talking to subagents

  3. ferrao commented on Oct 16, 2025

    @ferrao
    ContributorAuthor

    @ferrao is this specifically with a subagent? Currently you can't talk to subagents which imo is a poor ux and we should fix

    is this specifically with a subagent

    If so I will close and link the other issue that tracks talking to subagents

    No, this is with a regular agent, I have tried it with a subagent first, but you told me I could not do it in another issue, so I tried it with an agent.

  4. rekram1-node commented on Oct 16, 2025

    @rekram1-node
    Collaborator

    Ahh I think I follow then, when you trigger the command it sends it to a certain agent, but then it doesnt actually change your selected agent...

    I see

  5. ferrao commented on Oct 19, 2025

    @ferrao
    ContributorAuthor

    Ahh I think I follow then, when you trigger the command it sends it to a certain agent, but then it doesn't actually change your selected agent...

    I see

    Indeed... But it's even worse... Because If I change it manually, I can start to interact with the agent that work has been delegated to (RESEARCH), but each input that I provide, is also somehow fed back to the main agent (PLAN) and I end up with two sessions, one for each agent, with similar, but different state. A whole mess, that I can not get out of.

  6. ferrao commented on Oct 19, 2025

    @ferrao
    ContributorAuthor

    So, what I am saying is that I identify 2 problems:

    1. When a command triggers an agent subtask, opencode does not change to that agent automatically
    2. If we change to that agent manually, interaction between user/agent somehow leaks to the main context
  7. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Collaborator

    @ferrao in regards to point 2 thats because you cant talk to a subagent, and I dont like that either I think we need to allow

  8. ferrao commented on Oct 19, 2025

    @ferrao
    ContributorAuthor

    @ferrao in regards to point 2 thats because you cant talk to a subagent, and I dont like that either I think we need to allow

    Not sure what you mean, I am getting very confused with how I am supposed to use the agents functionallity.
    My workflow is never about giving AI a task and waiting for it's conclusion on it's own.

    I always like to interact with AI to get to my end result. But still, I want to take advantage of having dedicated agents with different skills and commands that load appropriate context and trigger those conversations, but I am not able to do any of it.

    Am I trying to do something that is just completely off how this is supposed to work?

  9. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Collaborator

    @ferrao You said:

    If we change to that agent manually, interaction between user/agent somehow leaks to the main context

    What I interpreted this as:

    "When I try to talk to a subagent the conversation leaks to main context"

    What I was saying:

    Currently the primary agent or a command invokes a subagent, and you navigate to the child session, subsequent messages are sent to primary agent instead of the subagent. This is intentional, but i think it is confusing so it will likely be changed

  10. ferrao commented on Oct 19, 2025

    @ferrao
    ContributorAuthor

    @ferrao You said:

    If we change to that agent manually, interaction between user/agent somehow leaks to the main context

    What I interpreted this as:

    "When I try to talk to a subagent the conversation leaks to main context"

    What I was saying:

    Currently the primary agent or a command invokes a subagent, and you navigate to the child session, subsequent messages are sent to primary agent instead of the subagent. This is intentional, but i think it is confusing so it will likely be changed

    You keep saying subagent. I am not using those anymore, as you stated that interactive conversations with subagents are not possible in #2352 . Everything that I am saying in this issue, is regarding agents, not subagents.

  11. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Collaborator

    @ferrao but are you using subtask: true because that is a subagent, it was created so you could run things outside of primary context (ie: as a subagent)

    Sorry for any confusion

  12. ferrao commented on Oct 19, 2025

    @ferrao
    ContributorAuthor

    @ferrao but are you using subtask: true because that is a subagent, it was created so you could run things outside of primary context (ie: as a subagent)

    Sorry for any confusion

    I am using:

    "mode": "primary",
    

    I would have to set mode to subagent for it to be a subagent, no?

  13. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Collaborator

    Does your custom command have subtask in it?

  14. ferrao commented on Oct 19, 2025

    @ferrao
    ContributorAuthor

    Does your custom command have subtask in it?

    I have tried both options and I hit different problems.

    1. subtask=true, that session leaking thing happens. From your answers and latest comment, can I assume that this subtask option will override the agent configuration and make it work as a subagent, even if it is configured as a primary? If that is the case, can we update the docs, so that it becomes clear?

    2. subtask=false, The researcher agent is triggered initially, but no separate session is created, so I can not interact with it. Somehow, then main agent know about the agent's response and picks up from there, and everything continues/happens on the main session, so I loose the agent specific capabilities.

  15. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Collaborator

    For subtask we do document this: https://opencode.ai/docs/commands/#subtask

    But I suppose it needs to be more clear

  16. ferrao commented on Oct 20, 2025

    @ferrao
    ContributorAuthor

    For subtask we do document this: https://opencode.ai/docs/commands/#subtask

    But I suppose it needs to be more clear

    If you can confirm that this command config option will make the agent run as subagent, no matter how it is configured, I'll be happy to submit a doc PR with this change.

  17. rekram1-node commented on Oct 20, 2025

    @rekram1-node
    Collaborator

    @ferrao that is correct, sorry for the confusion

  18. rekram1-node commented on Oct 20, 2025

    @rekram1-node
    Collaborator

    closing since this is now documented to remove confusion, I will publish updated docs soon

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

Metadata

Metadata

Assignees

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