UAT: StreamConfig/RouteConfig buffer_size default is 1 but spec requires 10 #4051

Open
opened 2026-04-06 09:31:43 +00:00 by freemo · 0 comments
Owner

Background

The specification at docs/specification.md (lines 20871, 31246, 31460) clearly defines buffer_size for stream routes with a default value of 10:

buffer_size: 10            # Stream buffer size (default: 10)

And in the JSON schema section:

"buffer_size": {
  "type": "integer",
  "default": 10,
  "minimum": 1,
  "description": "Stream buffer size."
}

However, the implementation uses 1 as the default in three separate places, diverging from the specification.

Current Behavior

Three files hard-code buffer_size default as 1:

  1. src/cleveragents/reactive/stream_router.py line 88:

    buffer_size: int = 1
    
  2. src/cleveragents/reactive/route.py line 57:

    buffer_size: int = 1
    
  3. src/cleveragents/reactive/config_parser.py line 141:

    buffer_size=route_data.get("buffer_size", 1),
    

Steps to Reproduce:

from cleveragents.reactive.stream_router import StreamConfig, StreamType
config = StreamConfig(name='test', type=StreamType.REPLAY)
assert config.buffer_size == 10  # FAILS: actual value is 1

Expected Behavior

buffer_size defaults to 10 per the specification. When users create stream routes without explicitly setting buffer_size, they receive a buffer of 10 items — matching the spec-defined default for ReplaySubject streams.

Impact

ReplaySubject streams use buffer_size to determine how many items to replay to new subscribers. A default of 1 means only the last item is replayed, which is far more restrictive than the spec-intended 10. Any user relying on the documented default will observe incorrect replay behaviour.

Files to Fix

  • src/cleveragents/reactive/stream_router.py — Change buffer_size: int = 1buffer_size: int = 10
  • src/cleveragents/reactive/route.py — Change buffer_size: int = 1buffer_size: int = 10
  • src/cleveragents/reactive/config_parser.py — Change route_data.get("buffer_size", 1)route_data.get("buffer_size", 10)

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Metadata

  • Branch: fix/reactive-stream-config-buffer-size-default
  • Commit Message: fix(reactive): correct buffer_size default from 1 to 10 per spec
  • Milestone: (none — backlog)
  • Parent Epic: #397

Subtasks

  • Update StreamConfig.buffer_size default in src/cleveragents/reactive/stream_router.py from 1 to 10
  • Update RouteConfig.buffer_size default in src/cleveragents/reactive/route.py from 1 to 10
  • Update config_parser.py fallback in src/cleveragents/reactive/config_parser.py from 1 to 10
  • Add/update unit tests asserting StreamConfig() and RouteConfig() default buffer_size == 10
  • Add regression test: StreamConfig(name='test', type=StreamType.REPLAY).buffer_size == 10
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(reactive): correct buffer_size default from 1 to 10 per spec), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/reactive-stream-config-buffer-size-default).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Background The specification at `docs/specification.md` (lines 20871, 31246, 31460) clearly defines `buffer_size` for stream routes with a default value of `10`: ```yaml buffer_size: 10 # Stream buffer size (default: 10) ``` And in the JSON schema section: ```json "buffer_size": { "type": "integer", "default": 10, "minimum": 1, "description": "Stream buffer size." } ``` However, the implementation uses `1` as the default in three separate places, diverging from the specification. ## Current Behavior Three files hard-code `buffer_size` default as `1`: 1. `src/cleveragents/reactive/stream_router.py` line 88: ```python buffer_size: int = 1 ``` 2. `src/cleveragents/reactive/route.py` line 57: ```python buffer_size: int = 1 ``` 3. `src/cleveragents/reactive/config_parser.py` line 141: ```python buffer_size=route_data.get("buffer_size", 1), ``` **Steps to Reproduce:** ```python from cleveragents.reactive.stream_router import StreamConfig, StreamType config = StreamConfig(name='test', type=StreamType.REPLAY) assert config.buffer_size == 10 # FAILS: actual value is 1 ``` ## Expected Behavior `buffer_size` defaults to `10` per the specification. When users create stream routes without explicitly setting `buffer_size`, they receive a buffer of 10 items — matching the spec-defined default for `ReplaySubject` streams. ## Impact `ReplaySubject` streams use `buffer_size` to determine how many items to replay to new subscribers. A default of `1` means only the last item is replayed, which is far more restrictive than the spec-intended `10`. Any user relying on the documented default will observe incorrect replay behaviour. ## Files to Fix - `src/cleveragents/reactive/stream_router.py` — Change `buffer_size: int = 1` → `buffer_size: int = 10` - `src/cleveragents/reactive/route.py` — Change `buffer_size: int = 1` → `buffer_size: int = 10` - `src/cleveragents/reactive/config_parser.py` — Change `route_data.get("buffer_size", 1)` → `route_data.get("buffer_size", 10)` --- > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- ## Metadata - **Branch**: `fix/reactive-stream-config-buffer-size-default` - **Commit Message**: `fix(reactive): correct buffer_size default from 1 to 10 per spec` - **Milestone**: _(none — backlog)_ - **Parent Epic**: #397 ## Subtasks - [ ] Update `StreamConfig.buffer_size` default in `src/cleveragents/reactive/stream_router.py` from `1` to `10` - [ ] Update `RouteConfig.buffer_size` default in `src/cleveragents/reactive/route.py` from `1` to `10` - [ ] Update `config_parser.py` fallback in `src/cleveragents/reactive/config_parser.py` from `1` to `10` - [ ] Add/update unit tests asserting `StreamConfig()` and `RouteConfig()` default `buffer_size == 10` - [ ] Add regression test: `StreamConfig(name='test', type=StreamType.REPLAY).buffer_size == 10` - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(reactive): correct buffer_size default from 1 to 10 per spec`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/reactive-stream-config-buffer-size-default`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4051
No description provided.