Skip to content

fix: added responses input history column and fixed chunk conversion - #725

Merged
Pratham-Mishra04 merged 1 commit into
mainfrom
10-31-fix_added_responses_input_history_column_and_fixed_chunk_conversion
Nov 3, 2025
Merged

fix: added responses input history column and fixed chunk conversion#725
Pratham-Mishra04 merged 1 commit into
mainfrom
10-31-fix_added_responses_input_history_column_and_fixed_chunk_conversion

Conversation

@TejasGhatte

@TejasGhatte TejasGhatte commented Oct 31, 2025

Copy link
Copy Markdown
Collaborator

Summary

Add support for storing and displaying Responses API input history in logs, enabling better tracking and debugging of Responses API requests.

Changes

  • Added a new responses_input_history column to the logs database table
  • Created a database migration to add the new column
  • Modified the logging plugin to extract and store Responses API input messages
  • Updated the UI to display Responses input history in log details
  • Renamed LogResponsesOutputView to LogResponsesMessageView for reuse with both input and output
  • Fixed an issue in the post-hook runner by clearing ChatResponse after converting to ResponsesStreamResponse

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

  1. Make Responses API requests
  2. Check logs to verify input history is properly stored and displayed
  3. Verify that both input and output messages are properly displayed in the UI
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Breaking changes

  • Yes
  • No

The database schema has been updated with a new column. Users should run the application to trigger the migration.

Security considerations

No new security implications. The implementation follows the same patterns as existing log storage.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

TejasGhatte commented Oct 31, 2025

Copy link
Copy Markdown
Collaborator Author

@coderabbitai

coderabbitai Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Responses API input history is now captured and logged with each interaction for audit and debugging purposes.
    • Log details view displays responses input history alongside other logged data for improved visibility.
  • Refactor

    • Internal logging infrastructure reorganized to support responses input history tracking.

Walkthrough

Added capture, storage, and UI rendering for responses input history; updated logging extraction to return responses messages; added DB migration and table fields; adjusted response-stream conversion ordering and chat-response nullification.

Changes

Cohort / File(s) Summary
Database schema & migration
framework/logstore/migrations.go, framework/logstore/tables.go
Add responses_input_history DB column via new migrator and rollback; extend Log with ResponsesInputHistory (string) and ResponsesInputHistoryParsed ([]schemas.ResponsesMessage); persist/deserialize and include content in summaries.
Logging plugin
plugins/logging/main.go, plugins/logging/operations.go, plugins/logging/utils.go
extractInputHistory signature changed to return ([]schemas.ChatMessage, []schemas.ResponsesMessage); capture and store ResponsesInputHistory in InitialLogData; populate ResponsesInputHistoryParsed on initial log creation.
Response processing / transports
core/providers/utils.go, transports/bifrost-http/integrations/utils.go
Reordered streaming case handling; when converting ChatResponse to ResponsesStreamResponse, result.ChatResponse is nullified (removed) instead of also populating a separate ResponsesResponse representation.
UI & types
ui/app/logs/views/logDetailsSheet.tsx, ui/app/logs/views/logResponsesMessageView.tsx, ui/lib/types/logs.ts
Rename LogResponsesOutputViewLogResponsesMessageView and props; add rendering of responses_input_history in log details; add responses_input_history: ResponsesMessage[] to LogEntry types.

Sequence Diagram(s)

sequenceDiagram
    participant Client as BifrostRequest
    participant Logger as LoggerPlugin
    participant DB as LogStore
    participant Processor as ResponseProcessor
    participant UI as Log UI

    Client->>Logger: PreHook (request)
    Logger->>Logger: extractInputHistory()\nreturns (ChatMessages, ResponsesMessages)
    Logger->>DB: insertInitialLogEntry(with ResponsesInputHistoryParsed)
    Client->>Processor: Response chunks (streaming)
    Processor->>Processor: convert ChatResponse -> ResponsesStreamResponse\nnullify ChatResponse
    Processor->>Client: stream converted ResponsesStreamResponse
    DB-->>UI: fetch LogEntry
    UI->>UI: render responses_input_history\nusing LogResponsesMessageView
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas for extra attention:
    • plugins/logging/utils.go: ensure all call sites adapt to the new two-value return.
    • core/providers/utils.go: verify nullifying ChatResponse doesn't break downstream logic that expected both representations.
    • framework/logstore/migrations.go: confirm migration idempotency and rollback behavior.
    • UI component rename: confirm imports/usage updated across codebase.

"I hop through logs with whiskered cheer,
I stash each response that wandered here,
From bytes to rows the messages flow,
A tail of inputs — neat in a row.
— 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "fix: added responses input history column and fixed chunk conversion" is specific and related to the changeset. It accurately references two key aspects of the pull request: the addition of responses input history storage and the chunk conversion bug fix. However, there's a categorical inconsistency—the title uses the "fix:" prefix typically reserved for bug fixes, while the PR itself is marked as a "Feature" type change with the bug fix being a secondary concern. The title is clear and descriptive enough for a teammate to understand the primary changes, even if the prefix convention is questionable.
Description Check ✅ Passed The pull request description is well-structured and covers most required template sections: a clear summary explaining the purpose, detailed changes with rationale, correct type selection (Feature), appropriate affected areas checked, comprehensive testing instructions with commands, breaking change acknowledgment with explanation, security considerations, and a complete checklist. However, two template sections are absent: screenshots or recordings for the UI changes (logDetailsSheet.tsx, logResponsesMessageView.tsx) and links to related issues. These omissions are relatively minor for code-focused changes, and the description remains substantive and actionable.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c655174 and dc40e39.

📒 Files selected for processing (10)
  • core/providers/utils.go (1 hunks)
  • framework/logstore/migrations.go (2 hunks)
  • framework/logstore/tables.go (5 hunks)
  • plugins/logging/main.go (3 hunks)
  • plugins/logging/operations.go (1 hunks)
  • plugins/logging/utils.go (3 hunks)
  • transports/bifrost-http/integrations/utils.go (1 hunks)
  • ui/app/logs/views/logDetailsSheet.tsx (3 hunks)
  • ui/app/logs/views/logResponsesMessageView.tsx (2 hunks)
  • ui/lib/types/logs.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TejasGhatte
TejasGhatte marked this pull request as ready for review October 31, 2025 12:58

Pratham-Mishra04 commented Nov 3, 2025

Copy link
Copy Markdown
Collaborator

Merge activity

  • Nov 3, 4:50 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 3, 4:54 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 3, 4:54 AM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 10-28-feat_handle_common_tool_types_of_openai_and_anthropic_in_responses_api to graphite-base/725 November 3, 2025 04:50
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/725 to main November 3, 2025 04:52
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-31-fix_added_responses_input_history_column_and_fixed_chunk_conversion branch from c655174 to dc40e39 Compare November 3, 2025 04:53
@Pratham-Mishra04
Pratham-Mishra04 merged commit 7bf9091 into main Nov 3, 2025
3 of 4 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 10-31-fix_added_responses_input_history_column_and_fixed_chunk_conversion branch November 3, 2025 04:54
akshaydeo pushed a commit that referenced this pull request Nov 17, 2025
…725)

## Summary

Add support for storing and displaying Responses API input history in logs, enabling better tracking and debugging of Responses API requests.

## Changes

- Added a new `responses_input_history` column to the logs database table
- Created a database migration to add the new column
- Modified the logging plugin to extract and store Responses API input messages
- Updated the UI to display Responses input history in log details
- Renamed `LogResponsesOutputView` to `LogResponsesMessageView` for reuse with both input and output
- Fixed an issue in the post-hook runner by clearing `ChatResponse` after converting to `ResponsesStreamResponse`

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [x] UI (Next.js)
- [ ] Docs

## How to test

1. Make Responses API requests
2. Check logs to verify input history is properly stored and displayed
3. Verify that both input and output messages are properly displayed in the UI

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Breaking changes

- [x] Yes
- [ ] No

The database schema has been updated with a new column. Users should run the application to trigger the migration.

## Security considerations

No new security implications. The implementation follows the same patterns as existing log storage.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
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