Repository navigation
Description
Background
render_timelines renders KHI resource timelines via headless Chromium (/session/render-timeline) and returns inline mcpsdk.ImageContent (image/png) along with a Markdown summary. While this enables AI agents to visually inspect timelines in their own context window, several capabilities are missing when an agent uses render_timelines to author polished, self-contained incident explanation documents or RCA reports for end users.
Checklist of Enhancements
-
1. Issue a short-lived HTTP GET URL for rendered timeline PNGs (analogous to
request_file_upload/uploadurl) (feat(mcp): issue short-lived HTTP GET URLs for rendered timeline PNGs #1198, interactive scene URL added in feat(mcp): wire stateful scenes, annotations, and dual URLs into render_timelines #1241 / feat(mcp,web): add annotated timeline scenes to render_timelines #1253)- Problem:
handleRenderTimelines(pkg/server/mcp/workbench_render.go) only returnsmcpsdk.ImageContent(Data: pngBytes) and text metadata. MCP clients do not expose the inline base64 payload to the agent's shell or file tools, so the agent cannot embed the rendered image in Markdown (), save it alongside a report, or upload it to external documents. - Proposed Design:
- Follow the same pattern as
request_file_upload(pkg/server/uploadurl): store rendered PNG bytes in an in-memory TTL store and expose a short-lived HTTP GET endpoint (e.g.,GET /api/v1/rendered-timelines/<token>.png, withContent-Type: image/pngand a 30-minute TTL). - Include
ImageURLandExpiresAtinrenderTimelinesTemplateDataand render them inpkg/server/mcp/templates/render_timelines.md.tmplso agents can directly embed the URL in Markdown or fetch it viacurl.
- Follow the same pattern as
- Affected Files:
pkg/server/mcp/workbench_render.go,pkg/server/mcp/server.go,pkg/core/init/default/mcp.gopkg/server/mcp/templates/render_timelines.md.tmpl,pkg/server/mcp/testdata/render_timelines.golden.md
- Problem:
-
2. Support visual annotations, highlights, and time markers (
highlightLogIds,highlightTimelineIds,cursorTime,activeTimeRange) (feat(mcp): add timeline scene spec types and named palette registry #1220–feat(web): add row highlight, connector, callout, and deck scene ViewModel #1224, feat(mcp): add multi-window search and structured log excerpt slicer #1231–test(mcp): add stateful scene patch, branch, and CDP overlay integration tests #1242, fix(web): route multi-row evidence deck tethers behind upper cards #1250, feat(mcp,web): add annotated timeline scenes to render_timelines #1253)- Problem:
TimelineRenderSmartComponent(web/src/app/pages/timeline-render/timeline-render-smart.component.ts) binds empty defaults ([timelineHighlights]="{}",[selectedLogIndex]="-1",[highlightedLogIndexBitset],[timelineChartItemHighlights]="{}",[cursorTimeMS]="undefined",[activeTimeRangeMs]="undefined"). Even when an agent has identified the exact causal log IDs, timelines, and trigger timestamps viaget_timeline_logs/get_resource_revisions, it cannot highlight those rows, events, or time ranges in the rendered screenshot. - Proposed Design:
- Extend
RenderTimelinesInputandTimelineRenderRequestto accept optional highlight/annotation parameters:highlightTimelineIds([]string): highlight specific timeline rows (timelineHighlights).highlightLogIds([]string): highlight specific log events / revisions on the chart (timelineChartItemHighlights/highlightedLogIndexBitset).cursorTime(string, RFC3339): draw a vertical time marker line at a key timestamp (cursorTimeMS).activeTimeRange(startTime/endTime, RFC3339): shade a specific incident window (activeTimeRangeMs).- Optional callout/overlay labels for highlighted logs (
timelineHoverOverlayRequest).
- Extend
- Affected Files:
pkg/server/mcp/workbench_render.goweb/src/app/pages/timeline-render/timeline-render-smart.component.ts,timeline-render-smart.component.htmlweb/src/app/timeline/components/timeline-frame.component.ts
- Problem:
-
3. Render a static legend for revision states and event log types / severities
- Problem:
timeline-render-smart.component.htmlhardcodes[showLegend]="false". Furthermore,TimelineLegendComponent(web/src/app/timeline/components/timeline-legend.component.ts) only displays the legend for a single interactively selected timeline row. In a static PNG without mouse hover, readers cannot tell what revision bar colors/stripes (e.g.,PodPhaseReady vs. Pending vs. Terminating, deletion status) or event diamond colors (top half = severity, bottom half = log type) represent. - Proposed Design:
- Add a static, aggregate legend bar (enabled by default or via a
showLegendoption) to/session/render-timelinethat summarizes all revision states, log types, and severities present across the rendered timelines.
- Add a static, aggregate legend bar (enabled by default or via a
- Affected Files:
web/src/app/pages/timeline-render/timeline-render-smart.component.html,timeline-render-smart.component.tsweb/src/app/timeline/components/timeline-legend.component.ts
- Problem:
-
4. Auto-fit left index pane width and hide interactive-only UI controls in static renders (index pane auto-fit in feat(mcp,web): render timeline screenshots at Retina 2x resolution and fit stage dimensions to content #1219 / feat(mcp,web): add annotated timeline scenes to render_timelines #1253; hiding controls open in feat(web): hide interactive-only index controls in timeline renders #1243)
- Problem:
TimelineRenderSmartComponent.INDEX_PANE_WIDTHis hardcoded to300px(timeline-render-smart.component.ts), and.row-nameusestext-overflow: ellipsis(timeline-index.component.scss), truncating long Kubernetes Pod/Node names or replica hash suffixes (...) so readers cannot distinguish instances in the image alone.- Interactive-only controls (
more_vertcontext menu button.menu-buttonand expand/collapse chevrons.expand-button) remain visible in static screenshots, consuming horizontal space in the index pane.
- Proposed Design:
- Compute the left index pane width dynamically from the longest rendered resource label (or allow configuring
indexPaneWidth), and hide interactive-only buttons (.menu-button,.expand-button) when rendering in/session/render-timeline.
- Compute the left index pane width dynamically from the longest rendered resource label (or allow configuring
- Affected Files:
web/src/app/pages/timeline-render/timeline-render-smart.component.ts,timeline-render-smart.component.scssweb/src/app/timeline/components/timeline-index.component.html,timeline-index.component.scss
- Problem:
-
5. Add horizontal viewport time padding and decouple viewport range from log filter range
- Problem:
buildTimelineRenderRequest(pkg/server/mcp/workbench_render.go) setsViewStartTimeMs/ViewEndTimeMsto the exact same timestamps asFilterStartTimeNs/FilterEndTimeNswith zero horizontal margin. Events right atstartTimeorendTimeare half-clipped at the left/right edges of the WebGL canvas, and filtering logs to a narrow window prevents showing surrounding revision state bars for before/after context. - Proposed Design:
- Add automatic horizontal time padding (e.g., 3–5% of the time span on both sides) to
ViewStartTimeMs/ViewEndTimeMs, and optionally allow specifyingviewStartTime/viewEndTimeindependently fromfilter.startTime/filter.endTime.
- Add automatic horizontal time padding (e.g., 3–5% of the time span on both sides) to
- Affected Files:
pkg/server/mcp/workbench_render.go
- Problem:
-
6. Render at high DPI (
deviceScaleFactor: 2) for crisp text and WebGL shapes (feat(mcp,web): render timeline screenshots at Retina 2x resolution and fit stage dimensions to content #1219, feat(mcp,web): add annotated timeline scenes to render_timelines #1253)- Problem:
chromiumTimelineRenderer.RenderPNG(pkg/server/mcp/timeline_renderer.go) callspage.SetViewportSize(width, height)with the default1.0scale factor, producing 1x resolution images where small ruler timestamps, chip labels, and WebGL event diamonds appear blurry on high-DPI displays and in slides/documents. - Proposed Design:
- Configure Playwright's
DeviceScaleFactor(defaulting to2.0or configurable viaRenderTimelinesInput) when creating the browser context / page for timeline rendering.
- Configure Playwright's
- Affected Files:
pkg/server/mcp/timeline_renderer.gopkg/server/mcp/workbench_render.go
- Problem:
Activity
Evin009 commentedon Nov 4, 2026
hi @kyasbal this PR covers item 5 of #1193 (viewport padding for
render_timelines).viewStartTime/viewEndTimeto set the viewport independently of the log filter/render/timelinewhen no viewport is givenEvin009 commentedon Nov 5, 2026
I'd like to take item 4 (auto-fit index pane width and hide interactive-only controls in static renders) next, if no one's on it.