Skip to content

fix(acp): /read endpoint returns messages from ACP event store (#3143)#3151

Merged
aegis-gh-agent[bot] merged 1 commit into
developfrom
fix/3143-read-acp-transcript
May 10, 2026
Merged

fix(acp): /read endpoint returns messages from ACP event store (#3143)#3151
aegis-gh-agent[bot] merged 1 commit into
developfrom
fix/3143-read-acp-transcript

Conversation

@OneStepAt4time

Copy link
Copy Markdown
Owner

Summary

Fixes #3143, fixes #3139

When no JSONL transcript file exists (ACP mode), the /read, /transcript, and /transcript/cursor endpoints returned empty messages. ACP sessions store transcript data in the ACP event store, not JSONL files.

Changes

  • src/session-transcripts.ts: Added AcpEventStore injection + readFromAcpEvents() method that converts ACP events to ParsedEntry format
    • message.delta β†’ assistant/text (accumulates consecutive deltas)
    • thinking.delta β†’ assistant/thinking
    • tool.started β†’ assistant/tool_use
    • tool.completed β†’ assistant/tool_result or tool_error
    • approval.requested β†’ system/permission_request
  • Fallback applied in readMessages(), getCachedEntries() (powers /transcript and /transcript/cursor)
  • src/session.ts: Added setAcpEventStore() passthrough
  • src/server.ts: Wires ACP event store after initialization
  • 9 new tests covering all event types, accumulation, type transitions, and error cases

Verification

tsc --noEmit: βœ… 0 errors
npm run build: βœ… OK
npm test: βœ… 3971/3974 passed (1 pre-existing flaky, 2 skipped)

Backward Compatibility

  • JSONL-based sessions: unchanged (JSONL path takes precedence)
  • ACP sessions without event store data: returns empty (same as before, no regression)
  • ACP sessions with events: now returns messages (new functionality)

When no JSONL file exists (ACP mode), the /read, /transcript, and
/transcript/cursor endpoints now fall back to the ACP event store.

- Added AcpEventStore injection into SessionTranscripts
- readMessages() falls back to readFromAcpEvents() when no JSONL
- getCachedEntries() falls back to ACP events (powers /transcript)
- Converts ACP event types to ParsedEntry format:
  - message.delta β†’ assistant/text
  - thinking.delta β†’ assistant/thinking
  - tool.started β†’ assistant/tool_use
  - tool.completed β†’ assistant/tool_result or tool_error
  - approval.requested β†’ system/permission_request
- Accumulates consecutive deltas, flushes on type/messageId change
- Wires event store in server.ts after ACP init

Fixes #3143, fixes #3139

@aegis-gh-agent aegis-gh-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… Approved β€” all 9 merge gates passed.

ACP event store fallback for /read endpoint. Converts ACP events to ParsedEntry format. 9 tests. All CI green.

πŸ‘οΈ Argus

@aegis-gh-agent aegis-gh-agent Bot merged commit 49e516d into develop May 10, 2026
20 checks passed
@aegis-gh-agent aegis-gh-agent Bot deleted the fix/3143-read-acp-transcript branch May 10, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant