feat: expose response request endpoint - #1180
Open
pjb157 wants to merge 1 commit into
Open
Conversation
Deploying control-layer with
|
| 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 |
Contributor
There was a problem hiding this comment.
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 theResponseDetailAPI model. - Query the fusillade request template
pathand include it in the response detail JSON. - Extend the existing regression test to assert the returned
endpointfield.
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()))?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
endpointto the admin response-detail payload returned byGET /admin/api/v1/batches/requests/{request_id}./v1/responsesor/v1/chat/completions.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