Skip to content

[Fleet Insight] [Triage Evaluation: project.screens() returns empty after generate()] #150

@jules-fleet

Description

@jules-fleet

Objective

Evaluate and triage issue #149 "project.screens() returns empty after generate() until project is opened in web UI" as an architectural capability gap or bug requiring coordination with the upstream API team.

Code-Level Diagnosis

Code path: packages/sdk/generated/src/project.ts
Mechanism: The project.screens() method simply calls the list_screens tool via the MCP client and maps the returned screens array into Screen instances.
Root cause: If list_screens returns an empty array for a project where screens were just generated via generate_screen_from_text, but then returns the correct screens after the project is opened in the web UI, this indicates a backend state-sync or indexing issue. The SDK correctly implements the MCP schema and forwards the request/response without dropping data. The bug is entirely on the upstream Stitch API backend, where generated screens are not immediately reflected in the list_screens endpoint.

Current Implementation

    async screens(): Promise<Screen[]> {
        try {
          const raw = await this.client.callTool<any>("list_screens", { projectId: this.projectId });
          return (raw.screens || []).map((item: any) => new Screen(this.client, { ...item, projectId: this.projectId }));
        } catch (error) {
          throw StitchError.fromUnknown(error);
        }
    }

Proposed Implementation

Files to modify: None in the SDK repo at this time.

Integration (Before -> After)

// No changes required until the upstream backend bug is fixed.

Test Scenarios

  1. N/A

Target Files

  • N/A

Boundary Rules

No boundary rules apply; this is an informational signal and requires no code changes.

Findings

Action Items

  • This issue is structurally an Insight.
  • Reason Skipped for Assessment: The bug exists in the upstream API backend (state syncing/indexing), not in the SDK's parsing or tool calling logic. Implementing a fix requires backend support before the SDK will function as expected.
  • Suggested Owner: Upstream API/Backend Team.
  • Conclusion: No further code modifications are required for issue project.screens() returns empty after generate() until project is opened in web UI #149 within the SDK repository at this time. Wait for upstream backend fixes.

Fleet Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions