-
Notifications
You must be signed in to change notification settings - Fork 56
Description
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
- N/A
Target Files
- N/A
Boundary Rules
No boundary rules apply; this is an informational signal and requires no code changes.
Findings
- Issue Reference: project.screens() returns empty after generate() until project is opened in web UI #149
- Goal Directives: The initial directive requires focusing on actionability.
- Current State: The missing screens issue stems from the upstream
list_screensendpoint returning empty data immediately after generation. This cannot be mitigated within the SDK.
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
- Source:
jules:session:9008775986186413879 - Link: https://jules.google.com/session/9008775986186413879