Conversation
Signed-off-by: Keming <kemingyang@tensorchord.ai>
There was a problem hiding this comment.
Pull request overview
Adds provider/model tagging to the TUI’s HTTP request/response events so the selected model is visible directly in the event list.
Changes:
- Extend
displayRecordto carryProviderandModelmetadata and render it as a tag beside the endpoint label. - Parse provider from the HTTP URL and model from the decoded JSON body (with a Gemini URL fallback).
- Add unit tests covering OpenAI model extraction, Gemini URL model extraction, and localhost-as-local provider detection.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tui/model.go |
Renders a model tag next to HTTP endpoints and adds tag styling per provider. |
tui/format.go |
Extracts (provider, model) from HTTP events (URL + body) and populates displayRecord. |
tui/format_test.go |
Adds tests validating provider/model extraction behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Keming <kemingyang@tensorchord.ai>
There was a problem hiding this comment.
Pull request overview
This PR adds provider/model “model tags” to the TUI for HTTP request/response events by extracting model metadata from the HTTP payload/URL and rendering it inline in the event list.
Changes:
- Extend
displayRecordwithProvider/Modelfields and render a colored model tag next to the endpoint label in the list view. - Parse HTTP events to infer
providerfrom request URL andmodelfrom the request body (with a Gemini URL fallback). - Add unit tests to validate provider/model extraction for several providers and an unknown provider case.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tui/model.go |
Adds model-tag styles and renders the model tag in each list row. |
tui/format.go |
Extracts Provider/Model during JSONL parsing for HTTP events (URL + body parsing). |
tui/format_test.go |
Adds tests covering provider/model extraction behaviors. |
Comments suppressed due to low confidence (1)
tui/model.go:406
renderRecordLineonly truncatesrecord.Summary; with the new model tag,label/prefixcan easily exceedcontentWidth(e.g., narrow terminal or long model name), causing lines to wrap or overflow the viewport. Consider truncating the model tag (or the full label) based on remaining width before buildingprefix, solipgloss.Width(prefix)never exceedscontentWidth.
labelParts := []string{style.Render(record.Endpoint)}
if record.Model != "" {
labelParts = append(labelParts, modelTagStyle(record.Provider).Render(record.Model))
}
label := lipgloss.JoinHorizontal(lipgloss.Left, labelParts...)
cursor := " "
if selected {
cursor = cursorStyle.Render("> ")
}
link := renderPairLink(annotation)
prefix := lipgloss.JoinHorizontal(lipgloss.Left, cursor, ts+" ", link, label, " ")
summaryWidth := max(0, contentWidth-lipgloss.Width(prefix))
return lipgloss.JoinHorizontal(lipgloss.Left, prefix, truncateText(record.Summary, summaryWidth))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Keming <kemingyang@tensorchord.ai>
No description provided.