Skip to content

feat: expose response request endpoint - #1180

Open
pjb157 wants to merge 1 commit into
mainfrom
peter/expose-response-endpoint
Open

feat: expose response request endpoint#1180
pjb157 wants to merge 1 commit into
mainfrom
peter/expose-response-endpoint

Conversation

@pjb157

@pjb157 pjb157 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds endpoint to the admin response-detail payload returned by GET /admin/api/v1/batches/requests/{request_id}.
  • Populates the value from the persisted fusillade request template path, e.g. /v1/responses or /v1/chat/completions.
  • Adds a regression assertion covering the serialized detail response.

Why

The app-doubleword-private Responses detail page needs to show the endpoint under Summary. The frontend is blocked on this backend field going live so it can render the real request path instead of inferring it from the body shape.

Verification

  • cargo test -p dwctl test_get_batch_request_populates_created_by_email -- --nocapture

Copilot AI review requested due to automatic review settings June 25, 2026 13:28
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying control-layer with  Cloudflare Pages  Cloudflare Pages

Latest commit: ccaec8a
Status: ✅  Deploy successful!
Preview URL: https://c71a511f.control-layer.pages.dev
Branch Preview URL: https://peter-expose-response-endpoi.control-layer.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the admin “response detail” payload (GET /admin/api/v1/batches/requests/{request_id}) to include the OpenAI-compatible request path (endpoint), populated from the stored fusillade request template’s path, and adds a regression assertion for the serialized response.

Changes:

  • Add endpoint: Option<String> to the ResponseDetail API model.
  • Query the fusillade request template path and include it in the response detail JSON.
  • Extend the existing regression test to assert the returned endpoint field.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dwctl/src/api/models/batch_requests.rs Adds endpoint to the ResponseDetail response model/schema.
dwctl/src/api/handlers/batch_requests.rs Fetches and returns the request template path as endpoint, and asserts it in the existing test.

Comment on lines +285 to +296
let endpoint = sqlx::query_scalar::<_, String>(
r#"
SELECT t.path
FROM fusillade.requests r
JOIN fusillade.request_templates t ON r.template_id = t.id
WHERE r.id = $1 AND r.created_by IS NOT NULL
"#,
)
.bind(request_id)
.fetch_optional(state.db.read())
.await
.map_err(|e| Error::Database(e.into()))?;
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