Remove duplicate UI fields already provided by the platform

The adapter config schema was re-declaring model, promptTemplate, env,
extraArgs, timeoutSec, and graceSec which the Paperclip platform already
surfaces as standard fields, causing duplicate controls in the agent
configuration UI.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-12 17:28:13 +00:00
parent b59f571e0b
commit ea9ce27e55
2 changed files with 18 additions and 76 deletions
+16 -29
View File
@@ -21,15 +21,18 @@ describe("getConfigSchema", () => {
expect(uniqueGroups).toContain("Core"); expect(uniqueGroups).toContain("Core");
expect(uniqueGroups).toContain("Kubernetes"); expect(uniqueGroups).toContain("Kubernetes");
expect(uniqueGroups).toContain("Operational");
}); });
it("has model as required text field", () => { it("does not include platform-provided fields", () => {
const schema = getConfigSchema(); const schema = getConfigSchema();
const modelField = schema.fields.find((f: ConfigFieldSchema) => f.key === "model"); const keys = schema.fields.map((f: ConfigFieldSchema) => f.key);
expect(modelField).toBeDefined(); // These fields are provided by the platform and should not be duplicated
expect(modelField!.type).toBe("text"); expect(keys).not.toContain("model");
expect(modelField!.required).toBe(true); expect(keys).not.toContain("promptTemplate");
expect(keys).not.toContain("env");
expect(keys).not.toContain("extraArgs");
expect(keys).not.toContain("timeoutSec");
expect(keys).not.toContain("graceSec");
}); });
it("has imagePullPolicy as select with correct options", () => { it("has imagePullPolicy as select with correct options", () => {
@@ -60,22 +63,6 @@ describe("getConfigSchema", () => {
expect(field!.default).toBe(300); expect(field!.default).toBe(300);
}); });
it("timeoutSec defaults to 0", () => {
const schema = getConfigSchema();
const field = schema.fields.find((f: ConfigFieldSchema) => f.key === "timeoutSec");
expect(field).toBeDefined();
expect(field!.type).toBe("number");
expect(field!.default).toBe(0);
});
it("graceSec defaults to 60", () => {
const schema = getConfigSchema();
const field = schema.fields.find((f: ConfigFieldSchema) => f.key === "graceSec");
expect(field).toBeDefined();
expect(field!.type).toBe("number");
expect(field!.default).toBe(60);
});
it("retainJobs is a toggle", () => { it("retainJobs is a toggle", () => {
const schema = getConfigSchema(); const schema = getConfigSchema();
const field = schema.fields.find((f: ConfigFieldSchema) => f.key === "retainJobs"); const field = schema.fields.find((f: ConfigFieldSchema) => f.key === "retainJobs");
@@ -98,14 +85,14 @@ describe("getConfigSchema", () => {
} }
}); });
it("has env and extraArgs as textarea", () => { it("has nodeSelector and tolerations as textarea", () => {
const schema = getConfigSchema(); const schema = getConfigSchema();
const envField = schema.fields.find((f: ConfigFieldSchema) => f.key === "env"); const nodeField = schema.fields.find((f: ConfigFieldSchema) => f.key === "nodeSelector");
expect(envField).toBeDefined(); expect(nodeField).toBeDefined();
expect(envField!.type).toBe("textarea"); expect(nodeField!.type).toBe("textarea");
const extraArgsField = schema.fields.find((f: ConfigFieldSchema) => f.key === "extraArgs"); const tolField = schema.fields.find((f: ConfigFieldSchema) => f.key === "tolerations");
expect(extraArgsField).toBeDefined(); expect(tolField).toBeDefined();
expect(extraArgsField!.type).toBe("textarea"); expect(tolField!.type).toBe("textarea");
}); });
}); });
+2 -47
View File
@@ -3,15 +3,7 @@ import type { AdapterConfigSchema } from "@paperclipai/adapter-utils";
export function getConfigSchema(): AdapterConfigSchema { export function getConfigSchema(): AdapterConfigSchema {
return { return {
fields: [ fields: [
// Core fields // Core fields (model, promptTemplate, env, extraArgs are provided by the platform)
{
key: "model",
label: "Model",
type: "text",
hint: "OpenCode model id in provider/model format (e.g. anthropic/claude-sonnet-4-6)",
required: true,
group: "Core",
},
{ {
key: "variant", key: "variant",
label: "Variant", label: "Variant",
@@ -27,27 +19,6 @@ export function getConfigSchema(): AdapterConfigSchema {
hint: "Inject runtime config with permission.external_directory=allow", hint: "Inject runtime config with permission.external_directory=allow",
group: "Core", group: "Core",
}, },
{
key: "promptTemplate",
label: "Prompt Template",
type: "text",
hint: "Run prompt template",
group: "Core",
},
{
key: "extraArgs",
label: "Extra Arguments",
type: "textarea",
hint: "JSON array of additional CLI args appended to the opencode command",
group: "Core",
},
{
key: "env",
label: "Environment Variables",
type: "textarea",
hint: "KEY=VALUE pairs, one per line. Overrides inherited vars from the Deployment.",
group: "Core",
},
// Kubernetes fields // Kubernetes fields
{ {
@@ -148,23 +119,7 @@ export function getConfigSchema(): AdapterConfigSchema {
group: "Kubernetes", group: "Kubernetes",
}, },
// Operational fields // Operational fields (timeoutSec and graceSec are provided by the platform)
{
key: "timeoutSec",
label: "Timeout (seconds)",
type: "number",
default: 0,
hint: "Run timeout in seconds; 0 means no timeout",
group: "Operational",
},
{
key: "graceSec",
label: "Grace Period (seconds)",
type: "number",
default: 60,
hint: "Additional grace before adapter gives up after Job deadline",
group: "Operational",
},
], ],
}; };
} }