Skip to content

Commit e7a9b1b

Browse files
authored
fix(atlas): wire the canvas Initialize button to the deterministic endpoint (#114)
The 'initialize this project's graph' button dropped '/initialize-atlas-graph' into the chat composer and sent it, delegating graph creation to the AGENT — inheriting every fragility of the prompt path (skipped when the atlas binary is absent, or on short tasks). Meanwhile initGraph(), which calls thesisAPI.initProject → POST /api/thesis/project/init (the proven find-or-create endpoint) and then refetches + selects the new root, was defined but wired to nothing, and busy={initializing()} was dead. Point the primary button at initGraph() so it deterministically creates the graph without the agent or the atlas binary, and surfaces a typed error toast on failure. The secondary 'chat' action still drops the skill invocation for review when the user wants to resolve a plan/auth issue in chat.
1 parent c503ab6 commit e7a9b1b

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

frontend/workspace/src/thesis/ThesisCanvas.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -851,16 +851,16 @@ export function ThesisCanvas(): JSX.Element {
851851
when={selectedGraph()}
852852
fallback={
853853
<InitHero
854-
onInit={() => {
855-
// One-click: drop the skill invocation in the composer and send it.
856-
// The initialize-atlas-graph skill runs `openscience project init`
857-
// (idempotent) and seeds the graph; the canvas picks it up on the
858-
// next unlinked-refresh poll below.
859-
uiStore.setPrefill("/initialize-atlas-graph")
860-
uiStore.setPrefillSend(true)
861-
}}
862-
// Secondary: drop the same skill invocation in the composer WITHOUT
863-
// sending, so the user can review/edit before running it.
854+
// Primary: hit the deterministic find-or-create endpoint
855+
// directly (POST /api/thesis/project/init via thesisAPI) so
856+
// the button reliably creates the graph without depending on
857+
// the agent or the `atlas` binary. initGraph() refetches and
858+
// selects the new root, and toasts a typed error on failure.
859+
onInit={() => void initGraph()}
860+
// Secondary: route through the agent — drop the
861+
// initialize-atlas-graph skill invocation in the composer
862+
// WITHOUT sending, so the user can review/run it (useful when
863+
// the direct call reports a plan/auth issue to resolve in chat).
864864
onChat={() => uiStore.setPrefill("/initialize-atlas-graph")}
865865
busy={initializing()}
866866
/>

0 commit comments

Comments
 (0)