Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const runtimeEntries = [
const runtimes = runtimeStatusSourceCatalog(runtimeEntries, runtimeUrl, baseHref);
assert(runtimes, "an owner-prepared catalog recognizes its current source");
assert(runtimes.sources.every((s) => s.readOnly && s.kind === "runtime" && !s.hostAlias), "runtime readers never acquire SSH or execution authority");
equal(statusSourceForUrl(runtimes, "/status.json", "http://127.0.0.1:19801/chat/")?.id, "retained", "a relative entry on the prepared runtime stays scoped and read-only");
equal(activeStatusSourceForUrl(runtimes, runtimeEntries[1].status_url, runtimeUrl, baseHref).id, "fresh", "a failed or pending same-Goal source selection does not bounce to the loaded runtime");
equal(runtimeStatusSourceCatalog(undefined, runtimeUrl, baseHref), null, "existing services need no runtime catalog");
equal(runtimeStatusSourceCatalog(runtimeEntries, "http://127.0.0.1:19803/status.json", baseHref), null, "an unrelated service cannot replace source choices");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,16 @@ export function removeStatusSource(catalog: StatusSourceCatalog, sourceIdToRemov
export function statusSourceForUrl(catalog: StatusSourceCatalog, statusUrl: string, baseHref: string) {
if (!statusUrl.trim()) return localStatusSource;
const resolved = resolveFrontstageOpsStatusUrl(statusUrl, baseHref);
if (resolved.source?.isRelative) return localStatusSource;
let normalized = statusUrl.trim();
try {
normalized = new URL(normalized, baseHref).toString();
} catch {
return null;
}
if (resolved.source?.isRelative) {
return catalog.sources.find((source) => source.kind === "runtime" && source.statusUrl === normalized)
?? localStatusSource;
}
return catalog.sources.find((source) => source.statusUrl === normalized) ?? null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2790,7 +2790,7 @@ export function PersonalWorkspacePage({
onOpenDetails={() => setSelection({ kind: "goal", item: selectedGoal })} onSelect={setSelection} onView={setSelectedGoalTab}
selectedTodoId={drawerSelection?.kind === "todo" ? drawerSelection.item.todoId : null}
board={taskBoard(!settingsOpen && selectedGoalTab === "overview")} results={goalResults(!settingsOpen && selectedGoalTab === "overview")}
historyRefreshRevision={historyRefreshRevision} readSourceUrl={statusSourceControl?.activeSource.kind === "runtime" ? statusSourceControl.activeSource.statusUrl : undefined} proposals={proposals} onPreview={createPreview} />,
historyRefreshRevision={historyRefreshRevision} readSourceUrl={statusSourceControl?.activeSource.kind === "runtime" && statusSourceControl.connectionState !== "loading" && statusSourceControl.connectionState !== "error" ? statusSourceControl.activeSource.statusUrl : undefined} proposals={proposals} onPreview={createPreview} />,
tasks: taskBoard(!settingsOpen && selectedGoalTab === "tasks"),
files: goalResults(selectedGoalTab === "files" && !settingsOpen),
chat: agentWorkActive ? <GoalAgentWorkPage key={`${selectionScope}:${selectedWorkAgentId}`} goal={selectedGoal} agentId={selectedWorkAgentId!} readOnly={readOnly}
Expand Down
19 changes: 14 additions & 5 deletions apps/presentation/dashboard/src/views/dashboard-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3365,11 +3365,20 @@ export function DashboardPage() {
// entry: Back should return to the user's previous workspace view.
if (search.statusUrl !== url) {
await navigate({
search: (current) => ({
...current,
statusUrl: url,
workAgent: "statusUrl" in current && (!current.statusUrl || current.statusUrl === url) ? current.workAgent : undefined,
}),
search: (current) => {
const runtimeSourceChanged = Boolean(nextPayload.local_dashboard_api?.read_only_sources?.length
&& "statusUrl" in current && current.statusUrl && current.statusUrl !== url);
return {
...current,
statusUrl: url,
workAgent: "statusUrl" in current && (!current.statusUrl || current.statusUrl === url) ? current.workAgent : undefined,
// Node/pack ids are source-local even when the Goal ids coincide.
// Back restores the original source's URL and its own selection.
...(runtimeSourceChanged ? {research_goal: undefined, research_node: undefined,
research_group: undefined, research_analysis: undefined,
research_analysis_goal: undefined, research_pack: undefined} : {}),
};
},
});
}
if (!statusRequestIsCurrent(statusRequestFenceRef.current, request)) return false;
Expand Down
2 changes: 2 additions & 0 deletions docs/development/frontend-delivery.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ These are read transports, not connected execution Goals or a second registry.
The native status and complete validated Explore history stay scoped to the
physical source, including identical Goal ids in different containers. An
unavailable container fails visibly without replacement; refreshing retries.
Switching prepared readers clears source-local question and analysis selections;
Back restores the previous reader's URL and its own selection.
All mutation endpoints are denied. A read-only source does not imply an
analysis pack, model execution, adoption or validated benefit; analysis remains
unavailable until its existing owner binds the appropriate source pack.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ try {
const errors = [];
page.on("pageerror", error => errors.push(String(error)));
const url = new URL("/chat/", catalog[0].status_url);
url.search = new URLSearchParams({ goalId: "same-goal", view: "overview", statusUrl: catalog[0].status_url });
url.search = new URLSearchParams({ goalId: "same-goal", view: "overview", statusUrl: process.env.LOOPX_RUNTIME_READER_BEFORE === "1" ? catalog[0].status_url : "/status.json" });
await page.goto(url.toString());
await page.getByRole("heading", { name: "Retained research", exact: true }).waitFor();
if (process.env.LOOPX_RUNTIME_READER_BEFORE === "1") {
Expand All @@ -69,15 +69,19 @@ try {
await page.screenshot({path:resolve(output,"desktop.png")});
await page.getByLabel("研究历程", {exact:true}).getByRole("button", {name:"关系图", exact:true}).click();
assert.equal(await page.locator(".research-history-edges > g > path").count(),2);
await page.locator(".research-history-node").filter({hasText:"Retained route 0"}).click();
assert.equal(new URL(page.url()).searchParams.get("research_node"),"route0");
await page.getByLabel("选择控制面来源", {exact:true}).click();
await page.getByRole("option", {name:"Fresh",exact:true}).click();
await page.getByRole("heading",{name:"Fresh research",exact:true}).waitFor();
assert.equal(new URL(page.url()).searchParams.get("research_node"),null,"a source switch must not rebind the same node id in another physical source");
await page.locator(".research-history-coverage").filter({hasText:"92 / 92"}).waitFor();
await page.getByLabel("研究历程", {exact:true}).getByRole("button", {name:"关系图",exact:true}).click();
await page.locator(".research-history-node").filter({hasText:"Fresh route 0"}).waitFor();
assert.equal(await page.locator(".research-history-node").filter({hasText:"Retained route"}).count(),0);
await page.goBack();
await page.getByRole("heading",{name:"Retained research",exact:true}).waitFor();
assert.equal(new URL(page.url()).searchParams.get("research_node"),"route0","Back restores the original source-local selection");
await page.goForward();
await page.getByRole("heading",{name:"Fresh research",exact:true}).waitFor();
await page.reload();
Expand Down
Loading