Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/doctoring/contextual-orchestrator-vendored-sidecar.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
prioritized.
- **Decision record:** [`docs/adr/0003-contextual-orchestrator-vendored-free-zdr.md`](adr/0003-contextual-orchestrator-vendored-free-zdr.md)

## 2026-08-28 Strix request envelope

The first post-#1373 main Strix execution reached the gateway and selected
`openai/orchestrator/free`, but the pinned server rejected the initial agent
request with HTTP 413 (`request_too_large`). The vendored server's generic
`SecurityConfig.max_body_bytes` default is 64 KiB; Strix and Noema requests
include tool schemas and repository context and therefore need a larger,
still-bounded integration envelope. The review launcher now sets an explicit
8 MiB limit for this sidecar only; the library default remains unchanged for
other deployments. A 413 remains fail-closed if a request exceeds that bound.

## What changed

`pr-review-autofix.yml` now provisions the sidecar
Expand Down
16 changes: 16 additions & 0 deletions docs/product-technical-gap-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,22 @@ flowchart LR
Strix completion and an independently authorized Noema verdict remain
separate evidence items.

## 2026-08-28 post-#1373 request-envelope recheck

- #1373 was merged by `seonghobae` at `8f84b661e468de451ba5c076dc938f342bf52d70`
to exercise the post-merge runtime path. Main Strix run `33143805461`
reached the contextual-orchestrator sidecar and sent the qualified
`openai/orchestrator/free` request, then failed closed with HTTP 413
`request_too_large` from the pinned gateway. This proves the earlier model
qualification defect was repaired, but the review request envelope was
still smaller than the Strix/Noema tool-and-source context.
- The fix is scoped to the review launcher: use an explicit bounded 8 MiB
`SecurityConfig.max_body_bytes` for the sidecar while preserving the
contextual-orchestrator library's generic 64 KiB default. Noema run
`33143860315` was a successful `workflow_run` event handler but skipped
because the push event had no associated pull request; it is not an LLM
verdict.

## 5. 실행 루프와 고객의 다음 행동

각 hourly pass는 아래 순서를 유지한다.
Expand Down
11 changes: 10 additions & 1 deletion scripts/ci/contextual_orchestrator_review_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
from pathlib import Path


# The vendored server's generic 64 KiB default is intentionally conservative,
# but Strix and Noema send tool schemas plus repository context in one request.
# Keep the review-specific envelope bounded without weakening the library default.
REVIEW_MAX_BODY_BYTES = 8 * 1024 * 1024


def _free_report_rows(discovered: list[object]) -> list[dict[str, object]]:
"""Convert in-process discovered models into free-only report rows.

Expand Down Expand Up @@ -157,7 +163,10 @@ def main(argv: list[str] | None = None) -> int:
orchestrator,
host=args.host,
port=args.port,
security=SecurityConfig(auth_token=auth_token),
security=SecurityConfig(
auth_token=auth_token,
max_body_bytes=REVIEW_MAX_BODY_BYTES,
),
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Comment thread
seonghobae marked this conversation as resolved.
)
return 0

Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/contextual_orchestrator_review_sidecar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ python3 -m pip install --quiet --disable-pip-version-check --no-cache-dir \
-r "$requirements_lock"
PYTHONPATH="$ORCHESTRATOR_SOURCE:$ORG_REPO_ROOT" "$(command -v python3)" -c \
'from contextual_orchestrator.credentials import get_credential; from contextual_orchestrator.model_discovery import discover_all_models, free_discovered_models; from contextual_orchestrator.orchestrator import ModelClient, TaskOrchestrator, load_agents; from contextual_orchestrator.review_gateway import register_review_credentials; from contextual_orchestrator.server import SecurityConfig, serve'
PYTHONPATH="$ORCHESTRATOR_SOURCE:$ORG_REPO_ROOT" "$(command -v python3)" -c \
'from contextual_orchestrator.server import SecurityConfig; from scripts.ci.contextual_orchestrator_review_launcher import REVIEW_MAX_BODY_BYTES; SecurityConfig(auth_token="contract", max_body_bytes=REVIEW_MAX_BODY_BYTES)'
Comment thread
seonghobae marked this conversation as resolved.

discovery_report="$ORCHESTRATOR_WORK/discovery-free.json"
zdr_feed="$ORCHESTRATOR_WORK/openrouter-zdr-endpoints.json"
Expand Down
13 changes: 13 additions & 0 deletions tests/test_contextual_orchestrator_review_sidecar_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ def test_launcher_requires_gateway_token_and_a_provider_credential() -> None:
assert "requires at least one provider credential in the KV" in text


def test_launcher_sets_a_bounded_review_request_body_limit() -> None:
"""Large review envelopes fit without changing the library's generic default."""
text = _read(LAUNCHER)
assert "REVIEW_MAX_BODY_BYTES = 8 * 1024 * 1024" in text
assert "max_body_bytes=REVIEW_MAX_BODY_BYTES" in text


def test_sidecar_validates_the_pinned_server_body_limit_constructor() -> None:
"""The exact vendored SHA must accept the review envelope keyword at boot."""
text = _read(SIDECAR)
assert 'from contextual_orchestrator.server import SecurityConfig; from scripts.ci.contextual_orchestrator_review_launcher import REVIEW_MAX_BODY_BYTES; SecurityConfig(auth_token="contract", max_body_bytes=REVIEW_MAX_BODY_BYTES)' in text


def test_autofix_workflow_provisions_sidecar_with_all_five_secrets() -> None:
"""The write-capable autofix path bootstraps the gateway with the five keys."""
workflow = _read(AUTOFIX_WORKFLOW)
Expand Down
Loading