Skip to content

RSPEED: remove /query/direct endpoints (defer chat on cloud-agents) - #60

Merged
jameswnl merged 1 commit into
harnessfrom
remove-query-direct
Oct 1, 2026
Merged

jameswnl merged 1 commit into
harnessfrom
remove-query-direct

Conversation

@jameswnl

@jameswnl jameswnl commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Removes POST /v1/query/direct and /v1/query/direct/stream (chat on cloud-agents via ChatWorkflowRunner). Deferred because of the G5 cross-user runner leak and in-process spawn: none credential handling, and to keep #51 / cloud-agents#269 focused. Bring-back tracked in #59.

Refs #59

Removed

  • src/app/endpoints/query_direct.py, src/workflow/query_executor.py, src/workflow/middleware.py (only used by chat)
  • Router registration in src/app/routers.py; tests/unit/app/test_routers.py count 29 -> 28
  • tests/unit/cloud_agents/test_query_executor.py, test_middleware.py
  • tests/e2e/cloud_agents/test_query_direct_handler_e2e.py, test_otel_tracing_e2e.py, TestPromptValidation in test_step_executor_e2e.py

Edited

  • docs/devel_doc/openapi.json (regenerated), docs/design/cloud-agents/integration-architecture.md, e2e-testing-strategy.md, docstrings in jaeger_helpers.py and test_workflow_tracing_e2e.py

No dependency on PR #57 (limits.py); constants vanish with query_executor.py.

Tests

make format, make schema clean; make test-unit: 3358 passed, 1 skipped, 90% coverage. Remaining pyright/pylint findings are in untouched e2e files (pre-existing).

Breaking

The two endpoints are gone.

🤖 Generated with Claude Code

Removed:
- src/app/endpoints/query_direct.py (POST /v1/query/direct and /stream)
- src/workflow/query_executor.py (ChatWorkflowRunner bridge)
- src/workflow/middleware.py (only used by the chat runner)
- router registration; test_routers count 29 -> 28
- unit tests: test_query_executor.py, test_middleware.py
- e2e tests: test_query_direct_handler_e2e.py, test_otel_tracing_e2e.py,
  TestPromptValidation in test_step_executor_e2e.py
- openapi.json regenerated; design docs updated

Refs #59

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@beesarmy beesarmy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: approve

Clean removal. I verified completeness rather than trusting the file list:

Removal is complete

  • On the base branch, the only importers of workflow.query_executor / workflow.middleware / app.endpoints.query_direct are exactly the files this PR touches — no other src/ consumers, so nothing is left dangling.
  • On this branch, zero remaining references to query_direct, QueryDirect, query_executor, workflow.middleware, or get_default_middleware anywhere in src/ or tests/. MAX_PROMPT_LENGTH / MAX_INSTRUCTIONS_LENGTH are fully gone, and there is no limits.py coupling (consistent with the PR description).
  • Built the FastAPI app from this branch: openapi() yields 49 paths with no /v1/query/direct*, while /v1/query, /v1/streaming_query, and /v1/streaming_query/interrupt are intact. The three deleted modules are not importable.

Tests & schema

  • tests/unit/app/test_routers.py passes with the updated count of 28; tests/unit/cloud_agents/ collects and passes (96 passed) with the two deleted test modules gone.
  • docs/devel_doc/openapi.json is a pure deletion (2 paths + QueryDirectRequest schema) and is byte-identical to a fresh scripts/generate_openapi_schema.py run on this branch.
  • No test-list / Makefile / workflow references to the deleted test files. CI is green (3/3 Cloud Agents Tests).

Scope tracking

  • Breaking change is clearly called out, and the bring-back uses Refs #59 (not Closes), so nothing is prematurely closed. Correct.

Nits (non-blocking)

  1. [LOW] docs/design/cloud-agents/integration-architecture.md — the Migration Path diagram still styles Phase 1 (/query/direct endpoint) plus P2/P3 green under a "Green = done" legend, which now reads as shipped. The new Deferred callout covers the status table, but consider restyling p1–p3 or annotating the diagram as the original plan.
  2. [LOW] The title RSPEED: ... doesn't match pr-title-checker prefixes (RSPEED-<n>: ...). Not enforced on this fork (no checker run on this PR), but worth a retitle if this is ever upstreamed.

🤖 Reviewed by beesarmy via Claude Code

@jameswnl
jameswnl merged commit ba63d4a into harness Oct 1, 2026
3 checks passed
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.

2 participants