fix: correct codex setups
This commit is contained in:
+1
-6
@@ -4,9 +4,4 @@
|
||||
[mcp_servers.agent-builder]
|
||||
command = "uv"
|
||||
args = ["run", "--directory", "core", "-m", "framework.mcp.agent_builder_server"]
|
||||
cwd = "."
|
||||
|
||||
[mcp_servers.tools]
|
||||
command = "uv"
|
||||
args = ["run", "--directory", "tools", "mcp_server.py", "--stdio"]
|
||||
cwd = "."
|
||||
cwd = "."
|
||||
@@ -1,80 +0,0 @@
|
||||
name: Codex Issue Triage (Optional)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: "Issue number to triage"
|
||||
required: true
|
||||
type: string
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
if: |
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(github.event_name == 'issues' && github.event.label.name == 'codex')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Resolve issue number
|
||||
id: issue_ctx
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
INPUT_ISSUE: ${{ github.event.inputs.issue_number }}
|
||||
EVENT_ISSUE: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
|
||||
echo "issue_number=$INPUT_ISSUE" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "issue_number=$EVENT_ISSUE" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Run Codex triage
|
||||
id: run_codex
|
||||
uses: openai/codex-action@v1
|
||||
with:
|
||||
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
|
||||
safety-strategy: drop-sudo
|
||||
codex-args: '["--model","gpt-5-mini"]'
|
||||
prompt: |
|
||||
You are triaging a GitHub issue for the repository ${{ github.repository }}.
|
||||
|
||||
Use the GitHub CLI to fetch the full issue details:
|
||||
gh issue view ${{ steps.issue_ctx.outputs.issue_number }} --repo ${{ github.repository }}
|
||||
|
||||
Then produce a concise triage report with these sections:
|
||||
1) Category (bug, enhancement, question, documentation, invalid)
|
||||
2) Size estimate (small, medium, large)
|
||||
3) Duplicate risk (low/medium/high) with 1-2 keywords to search
|
||||
4) Missing information checklist
|
||||
5) Suggested maintainer comment to post
|
||||
|
||||
Keep the final output short, actionable, and repository-maintainer friendly.
|
||||
|
||||
- name: Post triage comment
|
||||
if: steps.run_codex.outputs.final-message != ''
|
||||
uses: actions/github-script@v7
|
||||
env:
|
||||
TRIAGE_COMMENT: ${{ steps.run_codex.outputs.final-message }}
|
||||
ISSUE_NUMBER: ${{ steps.issue_ctx.outputs.issue_number }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: Number(process.env.ISSUE_NUMBER),
|
||||
body: `### Codex Triage (Optional)\n\n${process.env.TRIAGE_COMMENT}`,
|
||||
});
|
||||
@@ -923,27 +923,8 @@ if ! prompt_yes_no " Configure Codex integration files now?" "y"; then
|
||||
fi
|
||||
|
||||
if [ "$CODEX_SETUP_ENABLED" = true ]; then
|
||||
mkdir -p "$SCRIPT_DIR/.codex"
|
||||
mkdir -p "$SCRIPT_DIR/.agents/skills"
|
||||
|
||||
if [ ! -f "$SCRIPT_DIR/.codex/config.toml" ]; then
|
||||
cat > "$SCRIPT_DIR/.codex/config.toml" <<'EOF'
|
||||
# Project-level Codex config for Hive.
|
||||
|
||||
[mcp_servers.agent-builder]
|
||||
command = "uv"
|
||||
args = ["run", "--directory", "core", "-m", "framework.mcp.agent_builder_server"]
|
||||
cwd = "."
|
||||
|
||||
[mcp_servers.tools]
|
||||
command = "uv"
|
||||
args = ["run", "--directory", "tools", "mcp_server.py", "--stdio"]
|
||||
cwd = "."
|
||||
EOF
|
||||
echo -e "${GREEN} ✓ Created .codex/config.toml${NC}"
|
||||
CODEX_CHANGES=$((CODEX_CHANGES + 1))
|
||||
fi
|
||||
|
||||
if [ ! -f "$SCRIPT_DIR/AGENTS.md" ]; then
|
||||
cat > "$SCRIPT_DIR/AGENTS.md" <<'EOF'
|
||||
# Hive Agent Instructions (Codex)
|
||||
@@ -1051,37 +1032,6 @@ else
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
|
||||
echo -n " ⬡ Codex MCP config... "
|
||||
if [ -f "$SCRIPT_DIR/.codex/config.toml" ]; then
|
||||
if "$PYTHON_CMD" - <<'PY' "$SCRIPT_DIR/.codex/config.toml" > /dev/null 2>&1
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
config_path = pathlib.Path(sys.argv[1])
|
||||
try:
|
||||
import tomllib
|
||||
except ModuleNotFoundError:
|
||||
raise SystemExit(1)
|
||||
|
||||
with config_path.open("rb") as f:
|
||||
data = tomllib.load(f)
|
||||
|
||||
servers = data.get("mcp_servers", {})
|
||||
if "agent-builder" not in servers or "tools" not in servers:
|
||||
raise SystemExit(1)
|
||||
PY
|
||||
then
|
||||
echo -e "${GREEN}ok${NC}"
|
||||
else
|
||||
echo -e "${RED}failed${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
elif [ "$CODEX_SETUP_ENABLED" = false ]; then
|
||||
echo -e "${YELLOW}-- (skipped)${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}--${NC}"
|
||||
fi
|
||||
|
||||
echo -n " ⬡ skills... "
|
||||
if [ -d "$SCRIPT_DIR/.claude/skills" ]; then
|
||||
SKILL_COUNT=$(ls -1d "$SCRIPT_DIR/.claude/skills"/*/ 2>/dev/null | wc -l)
|
||||
|
||||
Reference in New Issue
Block a user