fix: expose AgentRun skill assembly in v02 web

This commit is contained in:
Codex
2026-06-03 07:02:09 +08:00
parent b57ceff959
commit e2d4989468
9 changed files with 126 additions and 0 deletions
+38
View File
@@ -18,6 +18,44 @@ export const DEFAULT_HWLAB_AGENTRUN_SKILL_REFS = Object.freeze([
{ name: "hwlab-agent-runtime", path: "skills/hwlab-agent-runtime/SKILL.md", required: true, aggregateAs: "hwlab-agent-runtime" }
]);
export function createHwlabAgentRunAssemblySummary(options = {}) {
const env = options.env ?? process.env;
const toolAliases = normalizeResourceToolAliases(options.toolAliases ?? DEFAULT_HWLAB_AGENTRUN_TOOL_ALIASES);
const promptRefs = normalizeResourcePromptRefs(options.promptRefs ?? DEFAULT_HWLAB_AGENTRUN_PROMPT_REFS);
const skillRefs = normalizeResourceSkillRefs(options.skillRefs ?? DEFAULT_HWLAB_AGENTRUN_SKILL_REFS);
const repoUrl = optionalString(options.repoUrl ?? env.HWLAB_CODE_AGENT_AGENTRUN_REPO_URL ?? env.AGENTRUN_REPO_URL) ?? DEFAULT_HWLAB_AGENTRUN_REPO_URL;
const branch = optionalString(options.branch ?? env.HWLAB_BOOT_REF ?? env.HWLAB_CODE_AGENT_AGENTRUN_BRANCH ?? env.AGENTRUN_BRANCH) ?? DEFAULT_HWLAB_AGENTRUN_BRANCH;
const commitId = optionalString(options.commitId ?? env.HWLAB_COMMIT_ID ?? env.HWLAB_GIT_SHA ?? env.HWLAB_REVISION);
const namespace = optionalString(options.namespace ?? env.AGENTRUN_RUNTIME_NAMESPACE ?? env.HWLAB_CODE_AGENT_AGENTRUN_NAMESPACE) ?? DEFAULT_AGENTRUN_NAMESPACE;
const managerUrl = optionalString(options.managerUrl ?? env.HWLAB_CODE_AGENT_AGENTRUN_MGR_URL ?? env.AGENTRUN_MANAGER_URL) ?? DEFAULT_AGENTRUN_MANAGER_URL;
return {
status: skillRefs.length > 0 ? "ready" : "degraded",
provider: "agentrun-v01",
namespace,
managerUrl,
resourceBundle: {
kind: "git",
repoUrl,
branch,
commitId,
skillsDir: ".agents/skills"
},
counts: {
toolAliases: toolAliases.length,
promptRefs: promptRefs.length,
skillRefs: skillRefs.length
},
toolAliases: toolAliases.map((item) => ({ ...item })),
promptRefs: promptRefs.map((item) => ({ ...item })),
skillRefs: skillRefs.map((item) => ({ ...item })),
runtimeEnv: {
assembledRuntime: "HWLAB_CODE_AGENT_ASSEMBLED_RUNTIME",
skillsDirs: "HWLAB_CODE_AGENT_SKILLS_DIRS"
},
valuesPrinted: false
};
}
export const AGENTRUN_REUSABLE_CREDENTIAL_ENV_NAMES = Object.freeze([
"AUTH_PASSWORD",
"CODEX_API_KEY",
@@ -18,4 +18,11 @@ Do not use fallback execution paths:
When the user asks what skills are visible, mention the HWLAB bundle skills by name and manifest path before any generic model/system skill list.
MiniMax-M3 tool-call guidance:
- Keep every command tool call argument as valid JSON. Put shell metacharacters, pipes, quotes, and newlines inside one command string instead of emitting partial JSON fragments.
- Prefer `rg` for repository search. If `rg` is unavailable, use `find ... -name` plus plain `grep`; BusyBox `grep` may not support GNU flags such as `--include`.
- For GitHub issue/PR reads, prefer `gh issue view <number> --repo owner/name --json title,body,state,comments` or `gh pr view ... --json ...`; avoid plain `gh issue view` output that can be polluted by Projects Classic GraphQL warnings.
- If a command fails because the command arguments were malformed, report the malformed command and retry once with a shorter single-purpose command.
When the user asks to compile or operate `D601-F103-V2`, start from the Device Pod path with `hwpod bootsharp --pod-id D601-F103-V2`, then use `hwpod` job/status/output commands as needed. If the Device Pod path returns a named blocker, report that blocker and do not switch to fallback paths.