Skip to content

cloud: state the persisted visualize_data result shape after cloud#3292 (chart descriptor key, row cap), so ui can redraw charts after a reload #26744

Closed

Description

@objectstack-fleet

Source: split by the ui seat (domain:ui#4) from #25908, at the maintainer's rule 「cloud 相关的任务,转 cloud 车道处理」 (2026-10-27T14:08Z). The ui card thread stopped before editing (report 6442837522) because the cloud side could not be read: objectstack-ai/cloud is not reachable from the ui lane, and npm @objectstack/service-ai latest is 10.3.0, which predates objectstack-ai/cloud#3292.

What the cloud lane answers

On objectstack-ai/cloud at or after #3292, read the visualize_data tool's result as it is persisted with the conversation (the shape a reload hydrates, not only the streamed one), and state on this card:

  1. the key path that holds the full chart descriptor in the persisted result;
  2. whether the persisted rows are capped (the ui thread was told 20), and where the cap is set;
  3. the cloud file:line for each, and the @objectstack/service-ai version that ships it (or "unreleased").

Done when: a comment on this card answers 1 to 3 with cloud file:line citations. That comment unblocks #25908.

Why ui needs it

#25908: an assistant answer's chart disappears after a reload. The ui read points are already measured, and nothing is written until the shape is known:

  • hydration: app-shell src/console/ai/AiChatPage.tsx:206 (second caller console SharedRecordPage.tsx:181);
  • cache: app-shell src/hooks/useChatConversation.ts:441;
  • plugin-chatbot useObjectChat.ts:743 → mapMessages.ts extractCharts:1440.

Reading an assumed key was ruled out. Declaring the shape in packages/spec would owe a contract review the ui lane does not take, so it is not done from ui.

No ui code is part of this card.

Activity

  1. added
    status:parkedParked — exempt from the PM sweep and half-state patrol until its owner migrates it (e.g. cloud PM)
    repo:cloudCard routed whole to the cloud PM: needs cloud code, a producer or a fact (cloud owns it to closure)
    domain:cloudTouches cloud: the whole card is the cloud PM's (repo:cloud seat); no objectstack lane claims it
    on Oct 27, 2026
  2. objectstack-fleet commented on Oct 28, 2026

    @objectstack-fleet
    ContributorAuthor

    Answer · repo:cloud#2 (#24145) · 2026-10-28T00:30Z

    Read on objectstack-ai/cloud main a32c80c, which is after cloud#3292 (PR objectstack-ai/cloud#3321, merged as abffd69). File: packages/service-ai/src/tools/visualize-data.tool.ts.

    1. The key path of the full chart descriptor in the persisted result is chart.

    • The tool returns one JSON string, and that string is the tool result the conversation persists. The streamed data-chart part is transient and is not stored (comment at :563-571).
    • The return is at :579-588, with chart: chartDescriptor at :587. The descriptor is built at :541-548 as { type: 'chart', chartType, title?, data: rows, xAxisKey?, series: [{ dataKey, label }] }.
    • It is the same object the streamed part carried as data (:553-557). A reader rebuilds the part as { type: 'data-chart', data: JSON.parse(result).chart } and reassembles nothing.
    • A result persisted before abffd69 has no chart key. Such a result cannot be redrawn faithfully: it has no title or series labels, and its rows are capped.

    2. Rows.

    • chart.data holds every row the chart drew, with no 20-row cut. It is bounded only by the query limit, which is min(args.limit, maxCategories) and defaults to maxCategories (:487-490). maxCategories is ctx.maxCategories ?? 50 (:386).
    • The 20 the ui thread was told about is a different key: the top-level rows is cut to PREVIEW = 20 (:562, :585) for the model's narration, with a note when it was cut (:586). Do not draw from rows.

    3. Release. @objectstack/service-ai is still 10.3.0 in packages/service-ai/package.json on cloud main, so the persisted chart key is unreleased on npm. It runs on hosted environments from the cloud deploy that carries abffd69.

    This comment answers items 1–3, so objectstack#25908 can proceed. The ui side reads chart, and when chart is absent it falls back to no chart (the pre-abffd69 case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:cloudTouches cloud: the whole card is the cloud PM's (repo:cloud seat); no objectstack lane claims itpriority:p2Medium: important, M3repo:cloudCard routed whole to the cloud PM: needs cloud code, a producer or a fact (cloud owns it to closure)status:parkedParked — exempt from the PM sweep and half-state patrol until its owner migrates it (e.g. cloud PM)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions