Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

cli/observability: readTraceRing silently drops every record after an oversized line

Open Beginner friendly
#140 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli, observability

Research direction

Start in cli/observability/trace.go at readTraceRing around line 76, then check how the function handles scanner errors and how its callers report them. Reproduce the problem with normal records before and after an oversized line; done means later records are not silently dropped and a scanner failure is surfaced clearly.

Written by the indexing model from the issue text.

Description

bug

Problem

In packages/cli/observability/trace.go:76, readTraceRing reads trace records with a bufio.Scanner, which returns bufio.ErrTooLong and stops scanning entirely once it encounters a line longer than the scanner's buffer size. The function does not handle this error specially, so it silently stops reading at that point and returns only the records seen so far.

Impact

A single unusually long trace line (e.g. one containing a large payload) causes every subsequent record in the trace ring to be silently dropped from the result, with no indication to the caller that reading stopped early rather than reaching the natural end of the data.

Repro

  1. Write a trace ring file containing several normal-length records followed by one record exceeding bufio.Scanner's default (or configured) max token size, followed by more normal records.
  2. Call readTraceRing and observe the records after the oversized line are missing from the result, with no error surfaced to explain why.

Suggested fix

Increase the scanner's buffer size with Scanner.Buffer to a size that comfortably accommodates expected record sizes, and additionally check Scanner.Err() after the scan loop ends; if it is bufio.ErrTooLong, surface that explicitly (log a warning, or switch to a bufio.Reader-based line-by-line read for the remainder) rather than silently truncating the result.

Dominant language
Go
Stars
157
Forks
19
Avg merge
4h 4m
Merged PRs (30d)
81

Getting set up

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.

More from solongate/agent-security

All issues in solongate/agent-security

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.