Skip to content

ACP.resumeSession should not replay messages #30756

Description

@imnotlxy

Description

See https://agentclientprotocol.com/protocol/v1/session-setup#resuming-a-session.

Unlike session/load, the Agent MUST NOT replay the conversation history via session/update notifications before responding. Instead, it restores the session context, reconnects to the requested MCP servers, and returns once the session is ready to continue.

The code (in packages/opencode/src/acp/service.ts) reads:

const resumeSession = Effect.fn("ACP.resumeSession")(function* (params: ResumeSessionRequest) {
  const snapshot = yield* directorySnapshot(params.cwd)
  yield* request(
    () => input.sdk.session.get({ directory: params.cwd, sessionID: params.sessionId }, { throwOnError: true }),
    "session",
  )
  const messages = yield* request(
    () =>
      input.sdk.session.messages(
        { directory: params.cwd, sessionID: params.sessionId, limit: 20 },
        { throwOnError: true },
      ),
    "session",
  )

  ...

  yield* replayMessages(events, messages)

  ...
})

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions