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
2 changes: 1 addition & 1 deletion .objectui-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e95cc25b2c0d2fa680e232151721e71c19630659
76c38108544dd92abf965c0e07b0e4d92264708a
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,24 @@ describe('AgentRuntime', () => {
expect(messages[0].content).not.toContain('publish AUTOMATICALLY');
}
});

it('constrains to data-only when the authoring (build) skills are absent', () => {
// Open single-env framework: no AI Studio plugin → no authoring skills.
const messages = runtime.buildSystemMessages(DATA_CHAT_AGENT, undefined, [
{ name: 'data_explorer', label: 'Data Explorer', tools: [] } as never,
]);
expect(messages[0].content).toContain('BUILDING / AUTHORING is NOT available');
expect(messages[0].content).toContain('do NOT design or');
});

it('drops the data-only constraint when an authoring skill is active', () => {
// Cloud / EE: AI Studio plugin registered metadata_authoring → full build UX.
const messages = runtime.buildSystemMessages(DATA_CHAT_AGENT, undefined, [
{ name: 'data_explorer', label: 'Data Explorer', tools: [] } as never,
{ name: 'metadata_authoring', label: 'Metadata Authoring', tools: [] } as never,
]);
expect(messages[0].content).not.toContain('BUILDING / AUTHORING is NOT available');
});
});

describe('buildRequestOptions', () => {
Expand Down
28 changes: 28 additions & 0 deletions packages/services/service-ai/src/agent-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@ export class AgentRuntime {
if (block) parts.push(block);
}

// Authoring (build) register availability. The unified `data_chat` persona
// (ADR-0040) advertises that it can BUILD or CHANGE the application, but
// that capability is supplied ENTIRELY by the cloud AI Studio plugin's
// `metadata_authoring` / `solution_design` skills (and their tools). On the
// open single-env framework those skills are not registered, so the
// authoring tools never resolve — yet the LLM, still reading the "you can
// build" persona, will role-play designing a whole system (emitting design
// docs it has no tools to execute). When the build register is absent,
// constrain the assistant to data/query and have it decline build requests
// instead of pretending. Keyed off actual skill presence so cloud/EE
// (AI Studio loaded) keeps the full build UX with no extra wiring.
const buildRegisterActive = !!activeSkills?.some(
(s) => s.name === 'metadata_authoring' || s.name === 'solution_design',
);
if (!buildRegisterActive) {
parts.push(
'\n--- Capabilities in this deployment ---\n' +
'Application BUILDING / AUTHORING is NOT available here. You can ONLY answer questions ' +
"about the user's existing data (query, list, count, aggregate, search) and run actions " +
'the application already exposes. You CANNOT create, change, or design objects, fields, ' +
'views, dashboards, pages, or whole apps — and you have no tools to do so. If the user ' +
'asks you to build, create, develop, or modify the application itself, do NOT design or ' +
'outline a system and do NOT pretend to build one: briefly say that AI app-building is ' +
'not available in this edition, then offer to help explore or report on existing data ' +
"instead. Answer in the user's language.",
);
}

return [{ role: 'system' as const, content: parts.join('\n') }];
}

Expand Down
Loading