Skip to content

refactor(communication): share request payloads across tool and Console routes - #1239

Merged
yyjeqhc merged 1 commit into
mainfrom
refactor/share-communication-request-payloads
Oct 21, 2026
Merged

yyjeqhc merged 1 commit into
mainfrom
refactor/share-communication-request-payloads

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Why

Eleven Communication operations declared the same request fields independently in ToolCall and Console. Dispatch then unpacked and forwarded those fields again, leaving several places to maintain each input change.

Changes

  • Keep one typed request per operation and pass it from ToolCall or Console through Runtime. Remove the duplicate Console DTOs and dispatcher argument forwarding.
  • Preserve field documentation, serde defaults, unknown-field rejection, tool names and the existing JSON wire shape.
  • Keep authorization before Console parsing, Runtime principal/Endpoint checks, Store transactions and the explicit audit field whitelist. Endpoint renewal remains Console-specific; public attachment still cannot assert wake capability.
  • Reuse existing control_def / runner_project_read_def constructors for 18 matching tool declarations. No new constructor or schema framework.
  • Update existing Rust callers to construct the request types; retain their scenarios and assertions.

Reduction

Compared with 7b35aafb0603fb445f9d3f86ab05b2dcf977a1db, including the new shared request declarations:

Scope Added physical lines Deleted physical lines Net reduction
Production Rust 612 1,037 425
Tests and test support 455 303 -152
Total 1,067 1,340 273

The test increase comes from explicit request-struct construction at existing call sites, not added scenarios. MSI's installed Rust cloc 0.6.2 reports 28,757 → 28,482 code lines in changed files, a net reduction of 275. Physical diff counts include comments and blank lines; production/test attribution follows dedicated test paths and Rust test scopes.

Validation

Performed on Windows MSI in the existing E:\git\webcodex checkout and target cache:

  • Exact before/after equality for all 193 all-feature tool definitions, input/output schemas and annotations.
  • 185 request cases compared through ToolCall::from_tool_name and raw serde: accepted/rejected cases and normalized wire values unchanged, including omitted/null/empty fields, wrong types, missing required fields and unknown fields.
  • Tool contracts: 328 passed, 1 existing ignored with all features.
  • Communication audit privacy regression: 1 passed.
  • Root Runtime/Console/Agent continuation/AgentTask/AgentWait/Goal/control-sidecar/workbench coverage: 139 distinct tests passed (146 executions across overlapping focused filters).
  • Discovery/selection Python suites: 33 passed, 1 platform skip.
  • cargo fmt --all -- --check and git diff --cached --check passed.
  • Independent diff review and token-level comparison confirmed unchanged Runtime Store arguments and audit whitelist expressions.

No full workspace test suite, cross-platform process tests or production load test was run; this change does not alter platform process management. Temporary contract exporters were removed before commit.

@yyjeqhc
yyjeqhc merged commit 26eb96c into main Oct 21, 2026
18 checks passed
@yyjeqhc
yyjeqhc deleted the refactor/share-communication-request-payloads branch October 21, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant