Skip to content

Add the ability to manually set a session id when creating a new session #167

Description

@alexneyler

Describe the feature or problem you'd like to solve

A user creates a docker container with copilot cli available on it. The user sends a copilot -p command to the container to get a response from the agent. Ideally, future prompts from the user would use the same session. --resume <session-id> is available, but we don't know the right session id, and can only discover it using the interactive --resume command.

Proposed solution

I can think of a couple options that would work:

  1. Allow users to optionally specify a session id via a command line argument, like copilot -p <prompt> --session-id <session-id>
  2. Add a command line argument to run in the "previous session", like copilot -p <prompt> --prev-session

Example prompts or workflows

Option 1:
User creates a docker container with copilot running
User sends copilot -p <prompt> --session-id <session-id> to start a new session
User sends a follow-up prompt with the --resume option to resume the previously created session, copilot -p <prompt> --session-id <session-id>

Option 2:
User creates a docker container with copilot running
User sends copilot -p <prompt> to the container to start a new session
User sends a follow-up prompt with a flag indicating to re-use the last session copilot -p <prompt>--prev-session

Additional context

No response

Activity

  1. lostintangent commented on Oct 2, 2025

    @lostintangent
    Member

    Based on your scenarios, it sounds like copilot -p <prompt> --continue would suit your needs? Assuming that flag resumed the most recently modified session? At which point, you wouldn't even need to worry about IDs at all (which I think is ideal)

  2. alexneyler commented on Oct 3, 2025

    @alexneyler
    Author

    Yes that will work! I just noticed it was released in the latest version. Thanks!

  3. lostintangent commented on Oct 3, 2025

    @lostintangent
    Member

    This is now shipped! Thanks again for the feedback, and let us know how things are going with the latest release 👍🏼

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions