Skip to content

feat: integrate Hunyuan Hy4 and parallel Conductor agents - #5

Merged
zskbot merged 23 commits into
mainfrom
feat/hy4-conductor-orchestration
Nov 5, 2026
Merged

zskbot merged 23 commits into
mainfrom
feat/hy4-conductor-orchestration

Conversation

@zskbot

@zskbot zskbot commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add a Tencent TokenHub OpenAI-compatible provider for the official Hunyuan hy4 model.
  • Add an opt-in conductor route that distributes review, security, performance, and architecture tasks across configured remote providers.
  • Add a bounded parallel executor with partial-failure handling and a configurable concurrency cap; legacy workflow execution remains sequential.
  • Keep the product-facing UI label as Agents while routing its default selection through Conductor.
  • Exclude the local canned demo agent from Conductor; return a clear setup message when no real remote provider is configured.
  • Require explicit HUNYUAN_ENABLE_PUBLIC_API=true before billable Hy4 calls are exposed through the public chat endpoint.
  • Add unit tests, architecture documentation, and an optional non-root Express API Docker image for security scanning.

Configuration

  • HUNYUAN_API_KEY (server-side secret)
  • HUNYUAN_ENABLE_PUBLIC_API=true only after reviewing auth, quotas, and cost exposure
  • HUNYUAN_BASE_URL (defaults to Tencent TokenHub international endpoint)
  • HUNYUAN_MODEL (defaults to hy4)
  • DEFAULT_MODEL=conductor or request model: "conductor"
  • AGENT_MAX_CONCURRENCY (1–8; default 4)

Verification

  • Added Vitest coverage for Hunyuan client configuration, HTTPS enforcement, parallel concurrency limits, legacy sequential execution, partial worker failures, and provider distribution.
  • The initial PR CI run passed tests, Vercel config validation, and frontend build at commit 00e237d.
  • Latest-head CI/security runs are being queued; no final latest-head result is claimed.

Safety / deployment

  • Conductor is analysis-only in this PR: no shell execution, filesystem writes, commits, or deployments. Isolated worktree execution remains a separate phase.
  • No credentials are committed.
  • Do not merge or deploy Production from this PR.
  • Vercel's linked ask-chatbot-uytr and ocodejs-home deployments report DEPLOYMENT_BLOCKED with the git-sources policy error link. The Vercel project update API rejected a policy update with Deployment Policy not found; a Vercel dashboard policy adjustment is still required before Preview/Production can be validated.
  • The ask-chatbot-uytr project currently has no Vercel environment variables. Hy4 will remain disabled until a TokenHub API key is added securely and public access is explicitly enabled.

RetriggerView in GreptileConfidence Score: 2/5

Fix the broken Express chat default, container startup, and Gemini key alias before merging.

Fix All in CursorFindings

  1. P1 Default chat gets rejected ▶
  2. P1 API container exits on startup ▶
  3. P1 Configured Gemini never runs ▶
Fix with agent prompt
### Issue 1
src/App.tsx:259
The new `conductor` default breaks chat through the Express server. `AIChatPanel` sends it to `/chat`, but `validateLegacyChatRequest` only accepts the old provider names. Every default submission gets HTTP 400 before reaching Conductor, even with valid credentials. Add `conductor` and `hunyuan` to the accepted names and test this request path.

### Issue 2
Dockerfile:27
The container runs as `node`, but `/app` remains owned by root. At startup, the server imports `src/db/database.js`, which creates `zsk.db` in that directory. The `COPY --chown` commands change only the copied files and directories, not `/app`, so opening the database fails before the server listens. Give `node` a writable database directory while keeping the non-root user.

### Issue 3
src/router/index.js:33-35
If only `LLM_API_KEY` is set, Conductor selects `geminiProvider`, but that adapter only reads `GEMINI_API_KEY`. This documented setup works with the existing Gemini runtime, yet the new Conductor route makes all four specialists return an unavailable-provider message without calling Gemini. Make the adapter accept the same key alias before including it as a configured provider.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds the Hunyuan adapter, Conductor specialist reports, a bounded parallel executor, and an optional non-root API image.

  • The Agents chat sends prompts to four specialists and combines their answers.
  • Conductor tasks run in parallel while the legacy workflow stays sequential.
  • Chat requests can use Hunyuan Hy4 through Tencent TokenHub.
  • The Express API can run in a non-root Docker container.
  • The setup notes use clearer provider wording.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  UI["Agents UI: model conductor"] --> Legacy["Express POST /chat"]
  Legacy --> Check["Supported model check"]
  Check --> Rejected["400: conductor not accepted"]
  API["Vercel POST /api/chat or Express /v1/chat"] --> Router["Provider router"]
  Router --> Direct["Hunyuan opt-in check"]
  Router --> Conductor["Conductor: configured remote providers"]
  Conductor --> Executor["Bounded specialist workers"]
  Executor --> Report["Markdown report"]
  Direct --> Hy4["Hunyuan Hy4"]
Loading

Reviews (1) · Last reviewed commit: "docs: clarify Conductor provider readine..." · Reviewed by Greptile

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-05T14:00:39.756338Z
We couldn’t complete this review. Comment @codex review to try again.
b0dfeb6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ask-chatbot-uytr Error Error Nov 5, 2026 2:00pm UTC
huggingface-space-kimi-demo Error Error Nov 5, 2026 2:00pm UTC

Request Review

@zskbot
zskbot marked this pull request as draft November 5, 2026 13:57
@zskbot
zskbot marked this pull request as ready for review November 5, 2026 13:57
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@zskbot
zskbot marked this pull request as draft November 5, 2026 14:00
@zskbot
zskbot marked this pull request as ready for review November 5, 2026 14:00
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread src/App.tsx Resolved
Comment thread Dockerfile Resolved
Comment thread src/router/index.js Resolved

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jshint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@zskbot
zskbot merged commit 6f008e3 into main Nov 5, 2026
40 of 55 checks passed

@zskbot zskbot left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit

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.

2 participants