Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

fix(pixel): keep machine-only preview links out of replies; send machine questions to host facts (#8238)

Mike Bradleyf304bdd4437e
diff --git a/ods/extensions/services/pixel-agent/plugin/host-observe.mjs b/ods/extensions/services/pixel-agent/plugin/host-observe.mjs
index 26e061939..8ac49bee4 100644
--- a/ods/extensions/services/pixel-agent/plugin/host-observe.mjs
+++ b/ods/extensions/services/pixel-agent/plugin/host-observe.mjs
@@ -342,7 +342,7 @@ export function createHostObserveTool({
return {
name: "pixel_ods_host_observe",
description:
- "Read selected ODS host facts through the external Operations Broker and return their receipt. Choose the typed host.* actions useful for this task, respecting the owner's exclusions. You can gather more facts in later calls. If a read times out, check its existing job ID before retrying. host.network-peer may resolve and probe one owner-named private LAN or Tailscale peer with bounded ports. This tool cannot scan a range, authenticate, execute commands, mutate a host, or approve plans.",
+ "Read selected ODS host facts through the external Operations Broker and return their receipt. Use it for questions about this machine, such as its GPUs, memory, storage or services: your sandbox sees only its own container and no GPUs. Choose the typed host.* actions useful for this task, respecting the owner's exclusions. You can gather more facts in later calls. If a read times out, check its existing job ID before retrying. host.network-peer may resolve and probe one owner-named private LAN or Tailscale peer with bounded ports. This tool cannot scan a range, authenticate, execute commands, mutate a host, or approve plans.",
parameters: {
type: "object",
additionalProperties: false,
diff --git a/ods/extensions/services/pixel-agent/plugin/workspace-preview.mjs b/ods/extensions/services/pixel-agent/plugin/workspace-preview.mjs
index c80d02e21..554762dfe 100644
--- a/ods/extensions/services/pixel-agent/plugin/workspace-preview.mjs
+++ b/ods/extensions/services/pixel-agent/plugin/workspace-preview.mjs
@@ -181,7 +181,7 @@ export const EMPTY_PUBLISHED_FILES_PREFIX = "Published files that are empty (0 b
// Portal's dashboard already shows this preview in its own card, so such a
// directive (seen live: [embed ref="site-..." title="Dragon" height="560" /])
// is at best repeated markup.
-export const PREVIEW_CARD_GUIDANCE = "Portal shows this preview to the owner in a card with your reply, so do not add an [embed ...] directive for it.";
+export const PREVIEW_CARD_GUIDANCE = "Portal shows this preview to the owner in a card with your reply, so do not add an [embed ...] directive for it or paste its localhost URL: that address opens only on this machine, and the card opens the preview for the owner.";
// Displayed with host-authoritative publication evidence, independently of model prose.
export const PREVIEW_STORAGE_DISCLOSURE = "Inputs in the embedded preview may be lost on reload. Storage behavior can differ in a separate tab; publishing alone does not guarantee saved data.";
diff --git a/ods/extensions/services/pixel-agent/tests/host_observe.test.mjs b/ods/extensions/services/pixel-agent/tests/host_observe.test.mjs
index 77e66a844..4076c24ca 100644
--- a/ods/extensions/services/pixel-agent/tests/host_observe.test.mjs
+++ b/ods/extensions/services/pixel-agent/tests/host_observe.test.mjs
@@ -251,6 +251,9 @@ test("host observation accepts only unique fixed read-only actions", () => {
test("host observation schema exposes no broker target, command, or approval input", async () => {
const tool = createHostObserveTool();
assert.equal(tool.name, "pixel_ods_host_observe");
+ // DGX Station: asked what the machine has, the agent read its sandbox and never
+ // mentioned the two GPUs; machine questions belong to this tool.
+ assert.match(tool.description, /questions about this machine, such as its GPUs.*sandbox sees only its own container and no GPUs/);
assert.deepEqual(tool.parameters.required, ["actions"]);
assert.deepEqual(Object.keys(tool.parameters.properties), [
"actions", "includeOdsStatus", "peer", "ports",
diff --git a/ods/extensions/services/pixel-agent/tests/workspace_preview.test.mjs b/ods/extensions/services/pixel-agent/tests/workspace_preview.test.mjs
index 51b97b3bd..30ed2b6e5 100644
--- a/ods/extensions/services/pixel-agent/tests/workspace_preview.test.mjs
+++ b/ods/extensions/services/pixel-agent/tests/workspace_preview.test.mjs
@@ -201,6 +201,9 @@ test("publishes only the exact existing workspace directory", async () => {
// site its own preview card was showing.
assert.ok(result.content[0].text.includes(`Verified browser URL: ${result.details.url}. ${PREVIEW_CARD_GUIDANCE} Inspection snapshot:`));
assert.match(PREVIEW_CARD_GUIDANCE, /card .*do not add an \[embed \.\.\.\] directive/);
+ // DGX Station: replies ended with "Preview is live: http://site-….localhost:9437/…", which
+ // opens only on the ODS machine itself; the card is how the owner opens the preview.
+ assert.match(PREVIEW_CARD_GUIDANCE, /or paste its localhost URL: that address opens only on this machine/);
assert.match(result.content[0].text, /publication and HTTP readback only, not successful startup, interactions or durable browser storage/);
// Publication renders nothing; the palette arrives with inspection.
assert.match(result.content[0].text, /Publication does not render the page; the inspection result also reports its rendered colors by area\. Check them before claiming a visible color or style change\. /);