fix: 22 audit findings across graph, harness, providers, language, and repl/rlm - #91
Conversation
…ware prune Co-authored-by: Medulla <medulla@tinyhumans.ai>
…rdered async checkpoint writes, barrier-gated update_state Co-authored-by: Medulla <medulla@tinyhumans.ai>
…t reservations, invalid streamed tool args, truncated-empty reset, single on_error dispatch Co-authored-by: Medulla <medulla@tinyhumans.ai>
…enforce request timeouts on degraded unary and list_models, latch 400 shape degradation Co-authored-by: Medulla <medulla@tinyhumans.ai>
…refs, dedupe graphs in compile_with_provenance, parse steering blocks Co-authored-by: Medulla <medulla@tinyhumans.ai>
…no alias leak in model_query, scope survives cancellation, cumulative cell budget Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (50)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 460d289661
ℹ️ 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".
Summary
A full-crate audit (multi-agent fan-out: 5 area-scoped finders, each finding adversarially verified, fixes independently code-reviewed) confirmed and fixed 22 defects across all five surfaces. Every fix carries a regression test proven red-before/green-after.
graph
resume()broadcast the resume value to every pending activation, not just the interrupted node(s) — never-run successor nodes observedctx.resumeon first execution, and a subgraph successor made the whole resume fail with "no checkpoint found". Resume is now keyed on the interrupted node(s) via new optionalinterrupted_nodescheckpoint metadata (legacy checkpoints fall back compatibly, with test coverage).prune()ignored checkpoint namespaces and deleted embedded subgraphs' checkpoint lineages, leaving threads permanently unresumable. The recency window now applies per namespace.DurabilityMode::Asyncspawned unordered background checkpoint writes (append-ordered backends could record a stale "latest") and abandoned in-flight writes on abort paths. Writes are now chained in order, drained on every exit, and a write is skipped when its predecessor failed.update_state(as_node)scheduled barrier successors without honouring the waiting-edge precondition; it now goes through the same gate as normal routing, andpending_activations/next_nodesare kept consistent.harness
ToolExecutionContextnow carries the parent'sCancellationToken).BudgetMiddlewarereservations were clobbered by concurrent runs, permanently leaking reserved tokens — now keyed per run-context instance (run ids are caller-supplied and collide).StreamAccumulatorturned unparseable streamed tool arguments intonullinstead ofToolCall::invalidpreserving the raw fragment.on_errorfired twice for a single hook failure; now dispatched exactly once.providers / tools
apply_prompt_tool_callsdestroyed every non-text content block (dropping Thinking blocks); non-text blocks are now preserved.list_modelshad no timeout at all — a stalled provider hung forever. Both now enforce the default request timeout (caller-owned clients keep their opt-out).language / registry
parse()hung forever on a token slice missing the trailingEofsentinel; it now errors.modelon subagent / repl_agent / subgraph nodes; both binding and the resolver now reject unregistered references.compile_with_provenanceskipped the duplicate-graph-name check thatcompileperforms.steering { … }node item did not parse; the documented grammar is now implemented (parse + AST retention; harness lowering tracked separately).repl / rlm
RlmSession::evalpanicked on non-ASCII output at themax_output_bytesboundary (UTF-8-unsafetruncate)..ragshcapability error became a fatal cell error, defeatingtry/catch; recoverable errors are now catchable while uncaught ones keep their typed form.model_querysent the registry alias as the provider model id, overriding the provider's configured model.RhaiInterpretersilently lost the persistent scope when a cell was cancelled or panicked; the scope now survives cancellation and a panic poisons it loudly.RlmRunner::runcould not be called twice (cumulative cell counter vs restarting budget check);max_cellsis now cumulative by contract, documented.ToolExecutionContextgained a public fieldcancellation: CancellationToken.NodeDeclgained a public fieldsteering: Option<SteeringDecl>.ToolExecutionContext {before bumping.model_queryno longer forwards the registry alias asModelRequest.model; middlewareon_errorfires once per failure.Validation
cargo fmt --checkclean;cargo clippy --all-targets --all-features -- -D warningsclean.cargo test --all-features: 2,030 passed, 0 failed (~40 new regression tests; baseline before the fixes was ~1,900 passing).update_statecheckpoint consistency) were fixed and re-verified.