Skip to content

Comments

Add CodegenRestDashboard: zero-deps REST dashboard, commands, local proxy, Cloudflare webhook#40

Draft
codegen-sh[bot] wants to merge 4 commits intomainfrom
codegen-bot/codegen-rest-dashboard-impl
Draft

Add CodegenRestDashboard: zero-deps REST dashboard, commands, local proxy, Cloudflare webhook#40
codegen-sh[bot] wants to merge 4 commits intomainfrom
codegen-bot/codegen-rest-dashboard-impl

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Feb 8, 2026

What’s included

  • CodegenRestDashboard/ (root-level)
    • commands/: zero-dependency Node scripts to call Codegen REST API
      • create_agent_run.js, resume_agent_run.js, list_agent_runs.js, get_agent_run.js, get_agent_run_logs.js (alpha), generate_setup_commands.js
      • config.js (tiny .env loader), http.js (fetch/https wrapper), utils.js (CLI args)
    • dashboard/: dependency-free single-tab UI served locally
      • index.html, styles.css, api.js, state.js, components/modal.js, components/toast.js, app.js
      • Features: auto-refresh active count in header, hover dropdown of active runs, logs dialog with polled stream, Active/Past filters, pin & watch runs, notifications, create/resume runs, Templates tab (CRUD), multi-step chaining via sequential resume calls
    • server.js: static server + secure local proxy (no token in browser) for /api/* endpoints
    • webhook_server.js: Cloudflare Worker for POST /webhook (www.pixelium.uk/webhook). Optional shared-secret header support
    • e2e_test.js: environment-conditional smoke test (list → get → logs; optionally create)
    • .env.example and folder-level .gitignore (ignore .env)

How to run

  1. Copy CodegenRestDashboard/.env.example to CodegenRestDashboard/.env and set:
    • CODEGEN_TOKEN=sk-…
    • ORG_ID=…
  2. Run dashboard: node CodegenRestDashboard/server.js → http://localhost:8080
    • No manual refresh; auto-updates counts and lists
    • Hover header for active list; click to open streaming logs dialog
  3. Commands (from repo root):
    • node CodegenRestDashboard/commands/list_agent_runs.js [--limit 10]
    • node CodegenRestDashboard/commands/get_agent_run.js --id 123
    • node CodegenRestDashboard/commands/get_agent_run_logs.js --id 123 [--limit 50]
    • node CodegenRestDashboard/commands/create_agent_run.js --prompt "Fix the bug" [--repo_id 123 --model "Sonnet 4.5"]
    • node CodegenRestDashboard/commands/resume_agent_run.js --id 123 --prompt "Follow-up"
    • node CodegenRestDashboard/commands/generate_setup_commands.js --repo_id 123 --prompt "Init sandbox"
  4. Webhook: deploy webhook_server.js to Cloudflare and route https://www.pixelium.uk/webhook → Worker
  5. E2E smoke: node CodegenRestDashboard/e2e_test.js (requires .env). Optional E2E_CREATE_PROMPT to force create.

Notes

  • Uses documented endpoints: create/get/list/resume runs; generate setup commands; alpha logs endpoint for polling stream
  • Model selection in UI uses the list you specified (passed as model)
  • Auto-chaining: select multiple templates per run; after completion, dashboard sequentially calls resume with each template’s text
  • Token is never exposed to the browser; all REST calls go through local proxy
  • Cloudflare only is mocked locally (via /api/webhook)

💻 View my work • 👤 Initiated by @ZeeeepaAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks


Summary by cubic

Adds a zero-dependency Codegen REST dashboard, CLI commands, a secure local proxy, and a Cloudflare webhook to manage agent runs without exposing tokens in the browser. Improves the UI and live updates with an All default view, icon tooltips, relative timestamps, saved chain plans with badges, and event polling with chaining dedupe.

  • New Features

    • Zero-deps dashboard: auto-refresh; Active/Past filter; hover active list; logs modal (polled); pin/watch; create/resume; Templates with sequential chaining; optional completion notifications; default to All; relative timestamps; icon-only actions with tooltips; chain plan persistence with badges; live updates via polling /api/events with chaining dedupe.
    • Zero-deps Node commands: list/get/create/resume runs, get logs (alpha), and generate setup commands.
    • Local server that serves the UI and proxies /api/* calls to Codegen (token stays server-side); provides /api/events for local webhook-driven updates.
    • Cloudflare Worker for POST /webhook with optional shared-secret header.
    • E2E smoke test to validate list → get → logs → optional create.
  • Migration

    • Copy CodegenRestDashboard/.env.example to .env and set CODEGEN_TOKEN and ORG_ID (optional API_BASE, WEBHOOK_SECRET).
    • Run the dashboard: node CodegenRestDashboard/server.js → http://localhost:8080.
    • Use CLI tools under CodegenRestDashboard/commands for API actions.
    • Optional: deploy webhook_server.js as a Cloudflare Worker and route /webhook.

Written for commit 55a6c53. Summary will update on new commits.

…al proxy, Cloudflare webhook worker, e2e smoke test)

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
…nd permission prompt

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
@codegen-sh
Copy link
Contributor Author

codegen-sh bot commented Feb 8, 2026

✅ E2E smoke test completed locally with provided org and API base.

  • list_agent_runs → OK (items found)
  • get_agent_run → OK (status returned)
  • get_agent_run_logs (alpha) → OK (logs returned)

Note: .env was used locally and is ignored by git; no secrets committed or printed.

…ls; pinned-first sort with single dense list; compact view filter

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
@codegen-sh
Copy link
Contributor Author

codegen-sh bot commented Feb 8, 2026

UI refinement pushed:

  • Single dense run list with pinned-first sort (no separate panels)
  • Space-saving cards; click to expand inline quick actions
    • Complete → Resume (template select or ad‑hoc prompt)
    • Active → Select follow‑up templates and “Add Chains”
  • Compact view selector (All / Active / Past)
  • Small action buttons (Logs / Pin / Watch)

No changes to auto-refresh, logs dialog, or header active count.

If you want me to swap the view selector to an “All by default” or tweak spacing further, I can push a quick follow‑up.

…imestamps; persist chain plans + badges; poll /api/events for live updates with chaining dedupe

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
@codegen-sh
Copy link
Contributor Author

codegen-sh bot commented Feb 8, 2026

Next refinements pushed:

  • Default view set to All; persist user choice in localStorage
  • Icon-only actions (🔎 Logs / 📍 Pin / 📌 Unpin / 👁 Watch / 🚫 Unwatch) with tooltips + aria-labels
  • Relative timestamps with absolute time on hover; periodic refresh
  • Persist chain plans per run in localStorage; cards show a concise “N chains” badge
  • Poll /api/events every 10s to live-update runs; on completion, auto-chain using persisted plans (deduped), then advance index

All changes maintain auto-refresh and streaming logs. Let me know if you want different icons, badge styles, or default view behavior.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant