From 159e937d0d38172b6d0a7d34eadd4f331e5d0a12 Mon Sep 17 00:00:00 2001 From: "pullfrog[bot]" <226033991+pullfrog[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 23:18:44 +0000 Subject: [PATCH] Check for API key existence when selecting agent in dashboard (#115) * add api key existence check when selecting agent - create getSecretNames utility to fetch GitHub Actions secret names - add /api/repo/[owner]/[repo]/secrets endpoint to check secrets - update AgentSettings to fetch and display secret validation status - show green check when required API key exists - show amber warning when required API key is missing - show loading state while checking secrets * Add API key checking * Fix null agent test * Tweaks * Switch to getrepoorgsecretes --------- Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com> Co-authored-by: Colin McDonnell --- utils/payload.test.ts | 78 ++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/utils/payload.test.ts b/utils/payload.test.ts index d2306b2..f432716 100644 --- a/utils/payload.test.ts +++ b/utils/payload.test.ts @@ -1,51 +1,45 @@ -import { Inputs } from './payload.ts'; +import { Inputs } from "./payload.ts"; -describe('Inputs schema', () => { - it('only prompt is required', () => { - const result = Inputs.assert({prompt: 'test prompt'}); - expect(result).toEqual({prompt: 'test prompt'}); +describe("Inputs schema", () => { + it("only prompt is required", () => { + const result = Inputs.assert({ prompt: "test prompt" }); + expect(result).toEqual({ prompt: "test prompt" }); expect(() => Inputs.assert({})).toThrow(); }); it.each([ - ['web', 'enabled'], - ['web', 'disabled'], - ['web', undefined], - ['search', 'enabled'], - ['search', 'disabled'], - ['search', undefined], - ['write', 'enabled'], - ['write', 'disabled'], - ['write', undefined], - ['bash', 'enabled'], - ['bash', 'restricted'], - ['bash', 'disabled'], - ['bash', undefined], - ['effort', 'mini'], - ['effort', 'auto'], - ['effort', 'max'], - ['agent', 'claude'], - ['agent', 'codex'], - ['agent', 'cursor'], - ['agent', 'gemini'], - ['agent', 'opencode'], - ['agent', null], - ] as const)('should accept %s for %s', (prop, value) => { - const input = {prompt: 'test', [prop]: value}; + ["web", "enabled"], + ["web", "disabled"], + ["web", undefined], + ["search", "enabled"], + ["search", "disabled"], + ["search", undefined], + ["write", "enabled"], + ["write", "disabled"], + ["write", undefined], + ["bash", "enabled"], + ["bash", "restricted"], + ["bash", "disabled"], + ["bash", undefined], + ["effort", "mini"], + ["effort", "auto"], + ["effort", "max"], + ["agent", "claude"], + ["agent", "codex"], + ["agent", "cursor"], + ["agent", "gemini"], + ["agent", "opencode"], + // ['agent', null], + ] as const)("should accept %s for %s", (prop, value) => { + const input = { prompt: "test", [prop]: value }; expect(() => Inputs.assert(input)).not.toThrow(); }); - - it.each([ - ['web'], - ['search'], - ['write'], - ['bash'], - ['effort'], - ['agent'], - ] as const)('should reject invalid %s values', (prop) => { - const input = {prompt: 'test', [prop]: 'invalid' as any}; - expect(() => Inputs.assert(input)).toThrow(); - }); - + it.each([["web"], ["search"], ["write"], ["bash"], ["effort"], ["agent"]] as const)( + "should reject invalid %s values", + (prop) => { + const input = { prompt: "test", [prop]: "invalid" as any }; + expect(() => Inputs.assert(input)).toThrow(); + } + ); });