Skip to content

Commit 05717ed

Browse files
xuyushun441-sysos-zhuangclaude
authored
feat(service-ai): open framework AI is query-only, declines app-building (#1803)
* chore: bump objectui to 76c38108544d test(e2e): lookup quick-filter coverage (CRM parity) (#1682) objectui@76c38108544dd92abf965c0e07b0e4d92264708a * feat(service-ai): open framework AI is query-only, declines app-building 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, role-plays designing a whole system (emitting design docs it has no tools to execute). Users saw the standalone open framework "develop" a full 进销存 app that it could not actually create. Fix: in buildSystemMessages, when no authoring (build-register) skill is active, append a deployment-capability note constraining the assistant to data/query and instructing it to decline build requests instead of pretending. Keyed off actual skill presence, so cloud/EE (AI Studio loaded) keeps the full build UX with zero extra wiring. Adds tests for both the absent and present build-register cases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent baa204c commit 05717ed

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

.objectui-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e95cc25b2c0d2fa680e232151721e71c19630659
1+
76c38108544dd92abf965c0e07b0e4d92264708a

packages/services/service-ai/src/__tests__/chatbot-features.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,24 @@ describe('AgentRuntime', () => {
619619
expect(messages[0].content).not.toContain('publish AUTOMATICALLY');
620620
}
621621
});
622+
623+
it('constrains to data-only when the authoring (build) skills are absent', () => {
624+
// Open single-env framework: no AI Studio plugin → no authoring skills.
625+
const messages = runtime.buildSystemMessages(DATA_CHAT_AGENT, undefined, [
626+
{ name: 'data_explorer', label: 'Data Explorer', tools: [] } as never,
627+
]);
628+
expect(messages[0].content).toContain('BUILDING / AUTHORING is NOT available');
629+
expect(messages[0].content).toContain('do NOT design or');
630+
});
631+
632+
it('drops the data-only constraint when an authoring skill is active', () => {
633+
// Cloud / EE: AI Studio plugin registered metadata_authoring → full build UX.
634+
const messages = runtime.buildSystemMessages(DATA_CHAT_AGENT, undefined, [
635+
{ name: 'data_explorer', label: 'Data Explorer', tools: [] } as never,
636+
{ name: 'metadata_authoring', label: 'Metadata Authoring', tools: [] } as never,
637+
]);
638+
expect(messages[0].content).not.toContain('BUILDING / AUTHORING is NOT available');
639+
});
622640
});
623641

624642
describe('buildRequestOptions', () => {

packages/services/service-ai/src/agent-runtime.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,34 @@ export class AgentRuntime {
160160
if (block) parts.push(block);
161161
}
162162

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

0 commit comments

Comments
 (0)