CopilotKit / CopilotKit/outpost

Pathfinder: parseJsonRpc joins multiple SSE data: lines with empty string

Open Beginner friendly
#123 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: integrations priority: low roadmap roadmap: later
Dominant language
TypeScript
Stars
7
Forks
3
Avg merge
7d 16h
Merged PRs (30d)
15

Description

Spun out of the #112 review (non-blocking, edge case).

parseJsonRpc concatenates all data: payloads with ''. Per the SSE spec, data lines within one event join with \n, and separate events are distinct messages. So a reply chunked across multiple data: lines, or one carrying a notification plus the response, would concatenate into invalid JSON and throw. Harmless for the real server's current single-line, single-event tools/call reply (and it's live-tested), but brittle if the server ever streams/chunks.

Fix direction: parse per-event (split on blank lines), take the last data: event's payload, or join a single event's data lines with \n. Add a test with a multi-event / multi-data: body.

File: packages/outpost/ai/src/pathfinder.ts (parseJsonRpc).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/outpost/ai/src/pathfinder.ts at parseJsonRpc and review how SSE data lines and event boundaries are currently handled. Add coverage for a multi-event or multi-data-line body, ensuring event payloads are separated correctly and data lines within one event join with newlines; done means the JSON-RPC response parses without invalid concatenation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.