Skip to content

chore: move lastUserPrompt and correlatingToolCallID to ResponsesRequestPayload#215

Merged
pawbana merged 3 commits intomainfrom
pb/responses-remove-paramswrap-part2
Mar 18, 2026
Merged

chore: move lastUserPrompt and correlatingToolCallID to ResponsesRequestPayload#215
pawbana merged 3 commits intomainfrom
pb/responses-remove-paramswrap-part2

Conversation

@pawbana
Copy link
Contributor

@pawbana pawbana commented Mar 12, 2026

Moved correlatingToolCallID() and lastUserPrompt() methods from responsesInterceptionBase to ResponsesRequestPayload

Copy link
Contributor Author

pawbana commented Mar 12, 2026

@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch 3 times, most recently from b35d815 to c0f64e9 Compare March 12, 2026 17:34
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-blocking branch 2 times, most recently from 6478817 to f55e5d4 Compare March 12, 2026 17:38
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch from c0f64e9 to b0e75df Compare March 12, 2026 17:38
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-blocking branch from f55e5d4 to 11aeeb0 Compare March 13, 2026 08:38
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch from b0e75df to f06f538 Compare March 13, 2026 08:38
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-blocking branch from 11aeeb0 to be0adac Compare March 13, 2026 08:53
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch from f06f538 to 09ff296 Compare March 13, 2026 08:53
@pawbana pawbana marked this pull request as ready for review March 13, 2026 08:54
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch from 09ff296 to 529a39b Compare March 13, 2026 15:25
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-blocking branch from be0adac to 809aae2 Compare March 13, 2026 15:25
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-blocking branch from 809aae2 to 93d2b9c Compare March 16, 2026 14:51
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch 2 times, most recently from 00c15d4 to af9c082 Compare March 16, 2026 15:29
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-blocking branch from 93d2b9c to 5f14de7 Compare March 16, 2026 15:29
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch from af9c082 to 746f730 Compare March 18, 2026 13:09
Copy link
Contributor

@ssncferreira ssncferreira left a comment

Choose a reason for hiding this comment

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

LGTM 💪 just a couple of nits

return nil, fmt.Errorf("read body: %w", err)
}
reqPayload, err := responses.NewResponsesRequestPayload(payload)
reqPayload, err := responses.NewResponsesRequestPayload(payload, slog.Make())
Copy link
Contributor

Choose a reason for hiding this comment

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

This creates a no-op logger, right? Maybe we can pass the logger as a param to lastUserPrompt (which is currently the only one needing the logger), since it is called from the interception, it could use the interception logger, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good catch, I was too hasty and somehow though this is test file.
This makes me re-think adding logger as part of ResponsesRequestPayload struct since there is no logger to pass here (logger is set in Setup method). I'll revet the logger change and add it as a parameter to lastUserPrompt which is a bit ugly but I don't want to make this PR even more complicated.

// empty string, false, nil. Unexpected shapes are treated as unsupported and do
// not fail the request path.
func (p *ResponsesRequestPayload) lastUserPrompt(ctx context.Context) (string, bool, error) {
inputItems := gjson.GetBytes(p.payload, reqPathInput)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maybe we should keep the p nil check?

Copy link
Contributor Author

pawbana commented Mar 18, 2026

Merge activity

  • Mar 18, 6:29 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 18, 6:30 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 18, 6:31 PM UTC: @pawbana merged this pull request with Graphite.

@pawbana pawbana changed the base branch from pb/responses-remove-paramswrap-blocking to graphite-base/215 March 18, 2026 18:29
@pawbana pawbana changed the base branch from graphite-base/215 to main March 18, 2026 18:30
@pawbana pawbana force-pushed the pb/responses-remove-paramswrap-part2 branch from 2e26427 to 1aa5101 Compare March 18, 2026 18:30
@pawbana pawbana merged commit 95ae940 into main Mar 18, 2026
5 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.

3 participants