@intern: add intern agent using local ornith:35b model (issue #53)
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
# Publish — PR (dev agents) or comment (pm/qa), always reply in the issue.
|
||||
#
|
||||
# Required env (provided by the workflow step):
|
||||
# GT AGENT_TOKEN TOKEN_PM TOKEN_SENIOR TOKEN_JUNIOR TOKEN_LEAD TOKEN_QA
|
||||
# GT AGENT_TOKEN TOKEN_PM TOKEN_INTERN TOKEN_SENIOR TOKEN_JUNIOR TOKEN_LEAD TOKEN_QA
|
||||
# NAME MODE NUM TITLE BRANCH NEW GITHUB_SERVER_URL GITHUB_REPOSITORY
|
||||
# IS_PR AUTOPILOT ISSNUM (autopilot: @qa label-gated merge/halt + auto-trigger @qa on a fresh PR)
|
||||
set +e # publish is best-effort: a grep-no-match / curl non-zero must NOT kill the step
|
||||
# Post/PR as the agent's OWN Gitea user when its token is configured; else the built-in bot.
|
||||
case "$NAME" in
|
||||
pm) TOK="$TOKEN_PM";; senior) TOK="$TOKEN_SENIOR";; junior) TOK="$TOKEN_JUNIOR";;
|
||||
pm) TOK="$TOKEN_PM";; intern) TOK="$TOKEN_INTERN";; senior) TOK="$TOKEN_SENIOR";; junior) TOK="$TOKEN_JUNIOR";;
|
||||
lead) TOK="$TOKEN_LEAD";; qa) TOK="$TOKEN_QA";; *) TOK="";;
|
||||
esac
|
||||
[ -z "$TOK" ] && TOK="$GT"
|
||||
@@ -64,7 +64,7 @@ prdesc=$(awk '/BEGIN_PR_DESCRIPTION/{f=1;next} /END_PR_DESCRIPTION/{f=0} f' /tmp
|
||||
if [ "$MODE" != "pr" ]; then
|
||||
git checkout -- . 2>/dev/null || true
|
||||
git clean -fd 2>/dev/null || true
|
||||
target=$(grep -oiE 'DELEGATE:[[:space:]]*@(junior|senior|lead|qa)' /tmp/agent_out.md 2>/dev/null | head -1 | grep -oiE '(junior|senior|lead|qa)' | tr '[:upper:]' '[:lower:]')
|
||||
target=$(grep -oiE 'DELEGATE:[[:space:]]*@(intern|junior|senior|lead|qa)' /tmp/agent_out.md 2>/dev/null | head -1 | grep -oiE '(intern|junior|senior|lead|qa)' | tr '[:upper:]' '[:lower:]')
|
||||
# Visible comment: the reply text, or a sensible line if the agent only emitted a marker.
|
||||
msg="$reply"
|
||||
case "$msg" in ""|"_(Made changes"*) msg=$([ -n "$target" ] && echo "Handing off to @$target." || echo "_(no further comment)_") ;; esac
|
||||
@@ -184,8 +184,8 @@ if [ "$MODE" != "pr" ]; then
|
||||
if [ -n "$AGENT_TOKEN" ]; then
|
||||
# Only delegate on an explicit "DELEGATE: @<agent>" line — never on a prose mention,
|
||||
# so an agent that is asking the maintainer a question does not hand off prematurely.
|
||||
target=$(grep -oiE 'DELEGATE:[[:space:]]*@(junior|senior|lead|qa)' /tmp/agent_out.md 2>/dev/null \
|
||||
| head -1 | grep -oiE '(junior|senior|lead|qa)' | tr '[:upper:]' '[:lower:]')
|
||||
target=$(grep -oiE 'DELEGATE:[[:space:]]*@(intern|junior|senior|lead|qa)' /tmp/agent_out.md 2>/dev/null \
|
||||
| head -1 | grep -oiE '(intern|junior|senior|lead|qa)' | tr '[:upper:]' '[:lower:]')
|
||||
if [ -n "$target" ] && [ "$target" != "$NAME" ]; then
|
||||
echo "auto-delegating to @$target"
|
||||
curl -sS -X POST -H "Authorization: token $AGENT_TOKEN" -H "Content-Type: application/json" \
|
||||
|
||||
Reference in New Issue
Block a user