Repository navigation
slack: validate data_visualization against Slack's per-chart caps - #36
Open
josephschorr wants to merge 1 commit into
Open
josephschorr wants to merge 1 commit into
josephschorr wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A time-series answer (e.g. "p95 over the last 3 hours") produces a data_visualization chart with far more than Slack's 20 points/categories, and/or >20-char timestamp labels. validateVizSeries only checked that series and axis_config.categories were non-empty, so such a chart passed local validation, reached chat.postMessage, and was rejected whole as invalid_blocks — which the sender degrades to plain text, dropping the chart silently. The agent sees its respond_to_user succeed and believes it posted a chart that never rendered. Enforce the limits slack-go's block_data_visualization.go documents (verified against the live API) so an over-dense/misaligned chart becomes a precise, model-facing, correctable error instead of a post-time silent degrade: - bar/area/line: 1–6 series, unique names; 1–20 x-axis categories; exactly one data point per category; category/series/point labels ≤20 chars; axis x_label/y_label ≤50 chars. - pie: 1–6 segments; segment labels ≤20 chars. Also surface Slack's ResponseMetadata.Messages (the per-block json-pointer reason) at the three blocks-rejected degrade log sites — SlackErrorResponse's Error() returns only the bare code, so the actionable detail was being discarded — and teach the model the caps up front in the respond_to_user authoring instructions.
josephschorr
force-pushed
the
slack-data-viz-validation-limits
branch
from
October 19, 2026 23:41
cc01b9e to
9f23380
Compare
This branch had an error being deployed
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.
Problem
A time-series answer ("p95 over the last 3 hours") rendered via the
data_visualizationBlock Kit component produced a chart with far more than Slack's 20 points/categories (and >20-char timestamp labels). Slack rejected the whole message withinvalid_blocks, andsender.godegraded it to plain text — so the chart silently vanished while the agent believedrespond_to_usersucceeded.Root cause:
validateVizSeriesonly checked thatseriesandaxis_config.categorieswere non-empty. It did not model the per-chart limits Slack actually enforces (documented in slack-go'sblock_data_visualization.go, verified against the live API):Datamust be 1–20 points, exactly one peraxis_config.categoriesentryA fine-grained time series blows straight past the 20-point/category cap (and 20-char timestamp labels), passes local validation, and only fails at post time — where the failure is invisible because the degrade log records just the bare
invalid_blockscode.Fix
validateVizSeries/validateDataVizto enforce Slack's documented caps, so an over-dense or misaligned chart becomes a precise, model-facing, correctable error (same philosophy the file already states) instead of a silent post-time degrade.ResponseMetadata.Messages(Slack's per-block json-pointer reason) at all threeblocks rejecteddegrade log sites —SlackErrorResponse.Error()returns only the bare code, so the actionable detail was being discarded.respond_to_userauthoring instructions (bucket long time ranges into ≤20 points, short labels, etc.).Tests
TDD: added failing cases to
TestValidateComponents(series/category/point caps, one-point-per-category alignment, label lengths, unique series names, pie segment cap/labels — plus boundary-accept cases at 20 points / 6 series) and a unit test for the newblocksRejectionDetailhelper.go test ./pkg/channels/...andgo vetpass.