fix(agent-runtime): bound current workflow-state response - #652
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough현재 워크플로 응답에 1 MiB 크기 제한을 적용한다. 초과, 빈 본문, 비바이트 청크, 읽기, UTF-8, JSON 파싱 실패는 Changes현재 워크플로 응답 경계 처리
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant 실행 가이드
participant 현재 상태 리더
participant 응답 스트림
participant JSON 파서
실행 가이드->>현재 상태 리더: 현재 워크플로 상태 요청
현재 상태 리더->>응답 스트림: 응답 청크 읽기
응답 스트림-->>현재 상태 리더: 바이트 청크 반환
현재 상태 리더->>현재 상태 리더: 1 MiB 한도 확인
현재 상태 리더->>JSON 파서: UTF-8 텍스트 파싱
JSON 파서-->>현재 상태 리더: 상태 데이터 또는 파싱 실패
현재 상태 리더-->>실행 가이드: 상태 데이터 또는 invalid_workflow_state_response
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review complete on 23fabd95f3ef886c6bef0ae9ff6ead50dc0ce342. The hosted RED is preserved, both follow-up CI defects were repaired rather than bypassed, malformed-stream coverage now exercises the added fail-closed branch, and application/reviewer/security/patch-validator gates are all fresh GREEN on this exact. No additional source, ownership-boundary, DDD, test/coverage, or merge-blocking finding remains in the two-file diff. This is COMMENT-only review; no self-approval is asserted.
…ent-response-bound-20260912 docs(agent-runtime): classify #652 as protected response-bound authority
Finding
Fresh protected
main@549c1fbe631e4c1e001900419772a2ffd779fe97letssrc/agent-runtime/procedural-current-lifecycle.tscallResponse.json()directly on the private Workflow / Task Execution Durable Object response before lifecycle-evidence admission. A corrupt or unexpectedly large internal response can therefore be buffered and parsed without a retained-byte ceiling before the ACL fails closed.Reality RED
Test-only exact
e003f8fdd47453fa3346b0ba7dff1642d9e1594dadded the hostile high-fragmentation response stream. Hosted application CI34644754403checked out that exact head, passed toolchain/install/typecheck, and failed atrelease tests, establishing the required source RED without changing production semantics.Causal repair and follow-up RCA
The production repair replaces
Response.json()with a fixed 1 MiB retained buffer, chunk-wise pre-copy ceiling enforcement, cancellation on oversize, reader-lock cleanup, fatal UTF-8 decoding, JSON admission, and the existing exact execution/plan/task validation. It remains a narrow Agent Runtime ↔ Workflow / Task Execution ACL and does not create lifecycle, task, retry, tool, Policy / Approval, provider-routing, quarantine, security, or outbound authority.Exact
7dd85e831788bd0b2b6f638d31861ff5856a7382exposed a Worker type-contract failure because Cloudflare'sTextDecoderConstructorOptionsrequires an explicitignoreBOM; exactc1184a3b25e2b45af1b810a2817a2d12ecaa91c5fixed that withignoreBOM:false, preserving ordinary JSON BOM handling. Its application CI34647774968then passed typecheck and all 4,710 tests but correctly failed the repository-wide 100% coverage gate on the newly added malformed non-byte chunk branch. Exact23fabd95f3ef886c6bef0ae9ff6ead50dc0ce342adds that hostile fixture instead of deleting the fail-closed branch.Exact-head GREEN
Current exact
23fabd95f3ef886c6bef0ae9ff6ead50dc0ce342is GREEN on all fresh hosted gates: application CI34648179930, reviewer-ci34648179936, required Security Scan34648179953, and patch-validator-image34648179940. Application CI also passed the release tests, release security/KPI/license/acquisition checks, and the final live-base drift refusal on this exact. Predecessor evidence is not reused.Boundary retained
This source integration is not an immutable Noema release, deployed Durable Object latency/recovery evidence, graph publication, or activation authority. ADR-0017 remains
Proposed, and external released contract/trust prerequisites remain owned by their canonical repositories.Summary by CodeRabbit
버그 수정
테스트