Skip to content

The AI agent is implemented twice, and only the browser copy runs #14

Description

@EnesYilmazcode

SYSTEM_PROMPT, CIRCUIT_TOOLS and validateActions exist in two hand-maintained copies:

  • backend/server.js:126 onward (dead code, never called by the shipped app)
  • circuit3d/index.html:314 onward (about 130 lines of copy-paste, this is the one that runs)

They have already drifted. The clearest example: the server copy and the browser copy disagree with breadboard.js about how many columns the board has (see the board-geometry issue).

Should be

  • One implementation, server-side, reached over /api/ask.
  • Delete the browser copy rather than trying to keep them in sync.
  • This lands naturally as part of moving the Gemini key out of the client.

Found in the 2026-08-16 audit (30-agent sweep, 481 findings). Every line reference was verified against main at the time of filing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentAI agent / tool callingbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions