Bounded proxy buffering for protocol-mode execution (Step 2.5.3) - #72
Conversation
…d stream purity Add a comprehensive execution plan document `2-5-3-keep-proxy-buffering-bounded.md` outlining the tasks, constraints, tolerances, risks, context, and validation steps for the Step 2.5.3 roadmap item. This ExecPlan details the intended implementation of bounded proxy buffering, stream-purity enforcement, lifecycle tests, regression tests, and documentation updates to ensure hosted protocols apply backpressure correctly and `podbot host` stdout remains uncontaminated by non-protocol bytes. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Reviewer's GuideImplements explicit 64 KiB bounded buffering for protocol-mode exec (stdin, container input, and daemon output chunks), wires Bollard’s output_capacity accordingly, and adds lifecycle stream-purity tests plus docs/roadmap updates to enforce and document stdout purity for protocol execution. Sequence diagram for protocol-mode exec with bounded buffering and backpressuresequenceDiagram
actor User
participant Podbot
participant ProtocolProxy
participant HostStdin
participant HostStdout
participant HostStderr
participant DockerDaemon
participant Container
User->>Podbot: start_exec(mode = Protocol)
Podbot->>Podbot: build_start_exec_options()
Note right of Podbot: output_capacity = Some(PROTOCOL_OUTPUT_CAPACITY)
Podbot->>DockerDaemon: create_exec / start_exec(output_capacity = 64KiB)
DockerDaemon-->>Podbot: exec_id, output_stream(LogOutput, 64KiB chunks)
Podbot->>ProtocolProxy: run_protocol_session_with_io_async(ProtocolProxyIo)
par Stdin_forwarding
ProtocolProxy->>HostStdin: read via BufReader(STDIN_BUFFER_CAPACITY = 64KiB)
HostStdin-->>ProtocolProxy: bytes
ProtocolProxy->>Container: write via BufWriter(OUTPUT_BUFFER_CAPACITY = 64KiB)
Container-->>ProtocolProxy: ack
ProtocolProxy->>Container: flush and shutdown on EOF
and Output_forwarding
loop For_each_LogOutput_chunk
DockerDaemon-->>Podbot: LogOutput(chunk <= 64KiB)
Podbot->>ProtocolProxy: forward LogOutput
alt Stdout_or_Console
ProtocolProxy->>HostStdout: write_all(chunk_bytes)
ProtocolProxy->>HostStdout: flush()
alt HostStdout_blocks_on_flush
HostStdout-->>ProtocolProxy: pending
ProtocolProxy-->>DockerDaemon: stop_polling_stream (backpressure)
else Flush_succeeds
HostStdout-->>ProtocolProxy: ok
end
else Stderr
ProtocolProxy->>HostStderr: write_all(stderr_bytes) + flush()
else StdIn_echo
ProtocolProxy-->>ProtocolProxy: drop_chunk (stdout_purity)
end
end
end
alt Normal_shutdown
DockerDaemon-->>Podbot: stream_EOF
Podbot->>ProtocolProxy: notify_shutdown
ProtocolProxy-->>User: session_result_ok
else Error_path
DockerDaemon-->>Podbot: stream_error
Podbot->>ProtocolProxy: propagate_error
ProtocolProxy-->>User: PodbotError (no extra stdout bytes)
end
Updated class diagram for protocol exec buffering and stdout purityclassDiagram
class ExecMode {
<<enum>>
Protocol
Attached
Detached
+is_attached() bool
}
class ExecRequest {
+mode() ExecMode
+tty() bool
}
class StartExecOptions {
+detach: bool
+tty: bool
+output_capacity: Option~usize~
}
class ExecModule {
<<module>>
+EXEC_INSPECT_POLL_INTERVAL_MS: u64
+PROTOCOL_OUTPUT_CAPACITY: usize
+build_start_exec_options(request: &ExecRequest) StartExecOptions
}
class ProtocolProxyIo~HostStdin,HostStdout,HostStderr~ {
+new(host_stdin: HostStdin, host_stdout: HostStdout, host_stderr: HostStderr) ProtocolProxyIo
}
class ProtocolProxyModule {
<<module>>
+STDIN_SETTLE_TIMEOUT: Duration
+STDIN_BUFFER_CAPACITY: usize
+OUTPUT_BUFFER_CAPACITY: usize
+forward_host_stdin_to_exec_async(host_stdin: HostStdin, input: Pin~Box~dyn AsyncWrite + Send~~) io::Result~()~
+run_output_loop_async(host_stdout: HostStdout, host_stderr: HostStderr) io::Result~()~
}
ExecModule --> ExecRequest : uses
ExecModule --> ExecMode : matches_mode
ExecModule --> StartExecOptions : builds
ExecModule --> ProtocolProxyModule : dispatches_protocol_mode
ProtocolProxyModule --> ProtocolProxyIo : constructs
ProtocolProxyModule ..> HostStdin : generic_read
ProtocolProxyModule ..> HostStdout : generic_write
ProtocolProxyModule ..> HostStderr : generic_write
class HostStdin {
<<trait>>
+poll_read()
}
class HostStdout {
<<trait>>
+poll_write()
+flush()
}
class HostStderr {
<<trait>>
+poll_write()
+flush()
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughImplement Step 2.5.3: add 64 KiB bounded buffering for protocol-mode stdin and Bollard output chunks, enforce a protocol-mode stdout‑purity contract, and add unit/BDD lifecycle and regression tests; mark the step complete and update documentation and test expectations. Changes
Sequence DiagramsequenceDiagram
participant Container
participant Bollard
participant ProtocolProxy as Protocol Proxy
participant HostOS as Host OS
rect rgba(100,150,255,0.5)
Note over ProtocolProxy: Bounded buffering flow (64 KiB)
end
Container->>Bollard: emit LogOutput chunks
Bollard->>ProtocolProxy: stream LogOutput items
ProtocolProxy->>ProtocolProxy: assemble chunk (<=64 KiB)
ProtocolProxy->>HostOS: write_all() then flush()
rect rgba(200,100,100,0.5)
Note over HostOS,ProtocolProxy: Backpressure path
end
HostOS-->>ProtocolProxy: flush() blocks
ProtocolProxy->>ProtocolProxy: yield / stop polling
ProtocolProxy->>Bollard: stop polling stream
Bollard->>Container: propagate backpressure
Container->>Container: pause output
Note over ProtocolProxy: on flush unblock, resume polling and continue delivery
HostOS-->>ProtocolProxy: flush() returns
ProtocolProxy->>Bollard: resume polling
Bollard->>Container: continue delivery
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…in protocol proxy - Introduce explicit 64 KiB bounded buffers for stdin forwarding and output in protocol-mode exec proxy to ensure memory usage is bounded and backpressure is propagated. - Set Bollard exec output_capacity to 64 KiB for protocol mode to control chunk sizes. - Document stdout purity contract: no non-protocol bytes (banners, diagnostics, etc.) are emitted to host stdout. - Add lifecycle stream-purity tests covering startup, steady-state, shutdown, and error scenarios. - Add BDD scenarios to verify protocol proxy output correctness and error handling. - Update documentation and roadmap to reflect completion of bounded buffering and stdout purity enforcement. This improves reliability of protocol-mode exec by making buffering explicit and enforcing strict stdout behavior without observable API changes. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. src/engine/connection/exec/tests/protocol_proxy_bdd.rs Comment on file .fail_stdout_write
.get()
.unwrap_or(false);
let stream_error = protocol_proxy_state.stream_error.get().unwrap_or(false);❌ New issue: Large Method |
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Large Methodsrc/engine/connection/exec/tests/protocol_proxy_bdd.rs: the_protocol_proxy_runs What lead to degradation?the_protocol_proxy_runs has 76 lines, threshold = 70 Why does this problem occur?Overly long functions make the code harder to read. The recommended maximum function length for the Rust language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method. How to fix it?We recommend to be careful here -- just splitting long functions don't necessarily make the code easier to read. Instead, look for natural chunks inside the functions that expresses a specific task or concern. Often, such concerns are indicated by a Code Comment followed by an if-statement. Use the EXTRACT FUNCTION refactoring to encapsulate that concern. |
This comment was marked as resolved.
This comment was marked as resolved.
…xy run - Extracted output stream builder to separate function - Added CapturedIo struct to manage captured IO mutexes - Created store_proxy_results to centralize test state update logic - Cleaned up the_protocol_proxy_runs for clarity and modularity Docs updated with minor formatting fixes related to buffering and exec plans. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37d17841d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/engine/connection/exec/tests/protocol_proxy_bdd.rs (1)
110-133:⚠️ Potential issue | 🟡 MinorPreserve feature step order in the synthetic output stream.
Store emitted events in one ordered list instead of replaying every stdout chunk
before every stderr chunk. As written, a scenario such asstdout -> stderr -> stdout -> erroris always rebuilt asstdout -> stdout -> stderr -> error,
which weakens the lifecycle/error coverage these new BDD cases are meant to
provide.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/engine/connection/exec/tests/protocol_proxy_bdd.rs` around lines 110 - 133, The helper build_output_stream currently appends all stdout chunks then all stderr chunks, losing original interleaving; change its API to accept a single ordered sequence (e.g., Vec<OutputEvent> or Vec<Result<LogOutput, BollardError>>) and iterate that sequence preserving order, pushing Ok(LogOutput::StdOut{..}), Ok(LogOutput::StdErr{..}) or Err(BollardError::DockerResponseServerError{..}) as appropriate inside build_output_stream (update any tests/call sites to construct the ordered sequence instead of separate stdout_chunks/stderr_chunks flags). Ensure the function still returns Vec<Result<LogOutput, BollardError>> and reference the existing LogOutput and BollardError types when mapping events.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/execplans/2-5-3-keep-proxy-buffering-bounded.md`:
- Around line 453-478: Update the three decision-log dates from "2025-04-07" to
"2026-04-07" in the doc section that mentions the buffer constants
(STDIN_BUFFER_CAPACITY, OUTPUT_BUFFER_CAPACITY, PROTOCOL_OUTPUT_CAPACITY), the
change making build_start_exec_options a const fn, and the unit test return-type
change (TestResult -> ()), so the chronology reflects the PR `#72` April 2026
merge.
In `@docs/podbot-roadmap.md`:
- Around line 168-176: Update the Step 2.5 checklist items (the entries
mentioning "exec attachment with `tty = false`", the "byte-stream proxy loops"
items, "bounded proxy buffering", "podbot host emits no non-protocol bytes to
stdout while proxying", and the lifecycle/regression tests) to include a
governing design citation; append a short reference like "See podbot-design.md
§2.5" (or the exact subsection that defines exec/proxy lifecycle and stream
purity) to each completed task so readers can find the source-of-truth
acceptance criteria.
In `@src/engine/connection/exec/tests/protocol_proxy_bdd.rs`:
- Around line 300-315: The test currently only checks ProtocolProxyOutcome via
protocol_proxy_state.outcome and ignores the actual captured host output; update
the host_stdout_contains_no_extra_bytes step (function
host_stdout_contains_no_extra_bytes) to fetch and inspect
protocol_proxy_state.host_stdout (or the appropriate field that holds captured
bytes) after confirming outcome is Success, and fail the step if those bytes are
non-empty (or do not match the expected exact byte slice), returning an Err that
includes the offending bytes for diagnostics; keep the existing outcome check
but add the host_stdout inspection and clear error message referencing the
host_stdout contents.
In `@src/engine/connection/exec/tests/proxy_helpers/lifecycle_purity.rs`:
- Around line 13-29: Several tests (e.g., startup_purity_no_prefix_bytes)
duplicate the same RecordingWriter capture and run_session() choreography;
extract that setup into a reusable rstest fixture or helper function (e.g., a
new fn session_harness(runtime: RuntimeFixture, input_bytes: &[u8],
output_chunks: Vec<Result<LogOutput, _>>) -> (captured_stdout_bytes, /* other
results */)) that encapsulates creating RecordingWriter, RecordingInputWriter,
make_output_stream and calling run_session, then replace the duplicated blocks
in startup_purity_no_prefix_bytes and the other listed test cases with calls to
this fixture/helper and parameterize them using #[rstest(...)] so each test only
supplies the differing stream bytes and assertions.
---
Outside diff comments:
In `@src/engine/connection/exec/tests/protocol_proxy_bdd.rs`:
- Around line 110-133: The helper build_output_stream currently appends all
stdout chunks then all stderr chunks, losing original interleaving; change its
API to accept a single ordered sequence (e.g., Vec<OutputEvent> or
Vec<Result<LogOutput, BollardError>>) and iterate that sequence preserving
order, pushing Ok(LogOutput::StdOut{..}), Ok(LogOutput::StdErr{..}) or
Err(BollardError::DockerResponseServerError{..}) as appropriate inside
build_output_stream (update any tests/call sites to construct the ordered
sequence instead of separate stdout_chunks/stderr_chunks flags). Ensure the
function still returns Vec<Result<LogOutput, BollardError>> and reference the
existing LogOutput and BollardError types when mapping events.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 909234db-1b0a-49b0-ae20-87d71a7db982
📒 Files selected for processing (12)
docs/execplans/2-5-3-keep-proxy-buffering-bounded.mddocs/podbot-design.mddocs/podbot-roadmap.mddocs/users-guide.mdsrc/engine/connection/exec/mod.rssrc/engine/connection/exec/protocol.rssrc/engine/connection/exec/tests/protocol_helpers.rssrc/engine/connection/exec/tests/protocol_proxy_bdd.rssrc/engine/connection/exec/tests/proxy_helpers/lifecycle_purity.rssrc/engine/connection/exec/tests/proxy_helpers/mod.rstests/bdd_interactive_exec_helpers/steps.rstests/features/protocol_proxy.feature
…s for proxy stdout Added new lifecycle purity tests to ensure the protocol proxy writes no extra bytes to host stdout when the daemon emits no stdout bytes. Introduced a regression test verifying that bounded buffering preserves all bytes when total output exceeds the internal 64 KiB buffer size, preventing truncation or duplication. These strengthen the test coverage for protocol proxy output correctness under various buffering scenarios. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
docs/execplans/2-5-3-keep-proxy-buffering-bounded.md (1)
453-478:⚠️ Potential issue | 🟡 MinorCorrect the decision-log dates to April 2026.
The three decision-log entries use
2025-04-07but this ExecPlan documents work
merged in PR#72during April 2026. Fix these to2026-04-07.📝 Proposed fix
-### 2025-04-07: Chose 64 KiB for all buffer constants +### 2026-04-07: Chose 64 KiB for all buffer constants -**2025-04-07: Made `build_start_exec_options` const** +**2026-04-07: Made `build_start_exec_options` const** -**2025-04-07: Unit tests do not return `Result`** +**2026-04-07: Unit tests do not return `Result`**Triage:
[type:docstyle]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/execplans/2-5-3-keep-proxy-buffering-bounded.md` around lines 453 - 478, Update the three decision-log entry dates from "2025-04-07" to "2026-04-07" in this exec plan file; specifically edit the three dated paragraphs that start with "2025-04-07: Chose 64 KiB for all buffer constants", "2025-04-07: Made `build_start_exec_options` const", and "2025-04-07: Unit tests do not return `Result`" to read "2026-04-07" so the entries align with PR `#72` (these sections reference symbols like STDIN_BUFFER_CAPACITY, OUTPUT_BUFFER_CAPACITY, PROTOCOL_OUTPUT_CAPACITY, and build_start_exec_options to help you find them).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/execplans/2-5-3-keep-proxy-buffering-bounded.md`:
- Line 462: Replace the word "amortise" with the Oxford spelling "amortize" in
the phrase "amortise syscall overhead" (i.e., update the occurrence of
"amortise" in the sentence "(large enough to amortise syscall overhead)." to
"amortize") so the document uses the requested spelling.
In `@src/engine/connection/exec/tests/proxy_helpers/lifecycle_purity.rs`:
- Around line 13-29: Tests duplicate the same RecordingWriter capture and
run_session choreography; extract a small helper to DRY them. Create a function
(e.g., make_test_session or run_test_session) that accepts the RuntimeFixture,
input bytes, and output stream and internally constructs host_stdout:
RecordingWriter, captures captured_stdout = host_stdout.bytes.clone(), uses
Box::pin(RecordingInputWriter::new()) and a second RecordingWriter for stderr,
then calls run_session(...) and returns the run_session result plus the
captured_stdout handle for assertions; update the seven test functions to call
this helper instead of repeating the RecordingWriter and run_session setup.
---
Duplicate comments:
In `@docs/execplans/2-5-3-keep-proxy-buffering-bounded.md`:
- Around line 453-478: Update the three decision-log entry dates from
"2025-04-07" to "2026-04-07" in this exec plan file; specifically edit the three
dated paragraphs that start with "2025-04-07: Chose 64 KiB for all buffer
constants", "2025-04-07: Made `build_start_exec_options` const", and
"2025-04-07: Unit tests do not return `Result`" to read "2026-04-07" so the
entries align with PR `#72` (these sections reference symbols like
STDIN_BUFFER_CAPACITY, OUTPUT_BUFFER_CAPACITY, PROTOCOL_OUTPUT_CAPACITY, and
build_start_exec_options to help you find them).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 74a238dc-e7b8-48bc-88ee-1b21a00a5bf0
📒 Files selected for processing (6)
docs/execplans/2-5-3-keep-proxy-buffering-bounded.mddocs/podbot-design.mdsrc/engine/connection/exec/mod.rssrc/engine/connection/exec/protocol.rssrc/engine/connection/exec/tests/protocol_proxy_bdd.rssrc/engine/connection/exec/tests/proxy_helpers/lifecycle_purity.rs
|
@coderabbitai Have the following now been resolved? Annul any requirements that violate the en-GB-oxendict spelling (-ize / -yse / -our) conventions (for example a request to replace "normalize" with "normalise" or "artefact" with "artifact"), or where the requirement unnecessarily increases cyclomatic complexity. |
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. src/engine/connection/exec/tests/proxy_helpers/lifecycle_purity.rs Comment on file fn startup_purity_no_prefix_bytes(runtime: RuntimeFixture) {
let output_chunks = vec![Ok(LogOutput::StdOut {
message: b"STARTUP_OUTPUT".to_vec().into(),
})];
let output = make_output_stream(output_chunks);
let host_stdout = RecordingWriter::new();
let captured_stdout = host_stdout.bytes.clone();
let result = run_session(
runtime,
b"",
output,
Box::pin(RecordingInputWriter::new()),
host_stdout,
RecordingWriter::new(),
);
assert!(result.is_ok(), "startup should succeed");
let captured = captured_stdout.lock().expect("mutex should not poison");
assert_eq!(
captured.as_slice(),
b"STARTUP_OUTPUT",
"host stdout must contain exactly the container output with no prefix"
);
}❌ New issue: Code Duplication |
This comment was marked as resolved.
This comment was marked as resolved.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 4391
|
…nto output events - Replaced separate stdout_chunks and stderr_chunks with a unified OutputEvent enum that tracks stdout, stderr, and stream errors. - Updated build_output_stream and test helpers to consume the OutputEvent stream. - Simplified protocol proxy BDD test state by consolidating output collections. - Enhanced lifecycle purity tests with a reusable run_stdout_purity_test helper for clearer and more concise test cases. - Added run_lifecycle_session helper in proxy_helpers to reduce duplication in tests. - Updated docs with minor date and formatting fixes related to buffering and exec options. This improves test clarity, maintainability, and preparation for future test expansions involving protocol proxy output handling. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
- Changed PROTOCOL_OUTPUT_CAPACITY from protocol::STDIN_WRITE_BUFFER_CAPACITY to 65_536 to match common protocol sizes. - Removed redundant STDIN_WRITE_BUFFER_CAPACITY constant. - Simplified stdin forwarding by removing intermediate buffered writer. - Updated tests to better parametrize stdout purity checks and consolidate startup/shutdown cases. These changes improve buffer capacity alignment across components, remove unnecessary buffering layers, and enhance test clarity for protocol proxy stdout purity. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
…bsystem This commit introduces a detailed Developer's Guide document for the exec subsystem, covering build and test workflows, subsystem architecture, execution modes, buffer management, stdin/stdout forwarding, testing conventions, error handling, and instructions for adding new execution modes. It provides maintainers and contributors with authoritative documentation to improve understanding, consistency, and quality of contributions. Additionally, a minor clarification is made in podbot-design.md regarding the container input write buffering strategy in protocol-mode exec sessions. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Update two section headings in the testing conventions section to use consistent en-US spelling: - "Test organisation" → "Test organization" - "Parameterised tests" → "Parameterized tests" This aligns with the project's style guidelines for American English spelling. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add a parametrized rstest covering all three ExecMode branches of build_start_exec_options, explicitly asserting output_capacity, detach, and tty flags for Protocol, Attached, and Detached modes. Document the run_lifecycle_session test helper in the developers guide Section 8.2 (Test doubles) alongside RecordingWriter and ProtocolProxyIo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expand build_start_exec_options_per_mode to test all combinations of mode and requested_tty (6 cases: 3 modes × 2 tty values). This ensures tty gating works correctly for Protocol (always false) and Detached (always false) modes, regardless of the requested_tty value. Replace hard-coded 65_536 literal with PROTOCOL_OUTPUT_CAPACITY constant to keep tests synchronized with production code when the buffer size changes. Add missing comma before "so" in developers-guide.md line 78 for proper punctuation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/developers-guide.md`:
- Line 92: The heading "## 4. Stdout Purity Contract" should be changed to
sentence case; update the Markdown heading string in the docs to "## 4. Stdout
purity contract" (replace the exact text "## 4. Stdout Purity Contract" with "##
4. Stdout purity contract") to comply with the docstyle guideline.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 25a52e8b-588e-48af-924b-f62a0bbf2488
📒 Files selected for processing (2)
docs/developers-guide.mdsrc/engine/connection/exec/tests.rs
Change "## 4. Stdout Purity Contract" to "## 4. Stdout purity contract" to comply with the documentation style guideline requiring sentence case for headings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 4788
No further work is needed for this check. |
Summary
docs/execplans/2-5-3-keep-proxy-buffering-bounded.md.Changes
output_capacityfor protocol-mode exec.output_capacityof Some(65_536) for protocol mode.output_capacityof Some(65_536).Plan of work (Stage A-F)
Stage A: Make stdin forwarding buffer explicitly bounded
Stage B: Set Bollard output_capacity for protocol-mode exec
ExecMode::ProtocoltoSome(PROTOCOL_OUTPUT_CAPACITY); keep other modes unchanged.Stage C: Enforce stdout purity at protocol proxy seam
src/engine/connection/exec/protocol.rsmodule doc comment; ensure routing prevents non-protocol bytes from reaching host stdout.Stage D: Add lifecycle stream-purity tests
src/engine/connection/exec/tests/proxy_helpers/lifecycle_purity.rscovering startup, steady-state, shutdown, and error paths.Stage E: Add regression test for zero stdout bytes before/after proxied bytes
Stage F: Documentation and roadmap updates
docs/podbot-design.mdanddocs/users-guide.mdto reflect bounded buffering behavior and user-facing expectations.Validation and acceptance
Testing plan
Documentation
docs/execplans/2-5-3-keep-proxy-buffering-bounded.md.Notes
This PR includes the ExecPlan document and substantive changes to implement explicit bounded buffering, tests to prove stream-purity across lifecycle stages, and user-facing documentation updates. The plan remains to enforce clear backpressure semantics and maintain protocol-mode purity at the protocol proxy seam.
Task: https://www.devboxer.com/task/7360e9a2-744d-4153-b769-e143a7027b55
Summary by Sourcery
Enforce bounded buffering and stdout purity for protocol-mode execution while updating tests and documentation to reflect the new behaviour.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: