Skip to content

[week-06] 25622005 - #304

Open
psyoung82 wants to merge 14 commits into
Q00:mainfrom
psyoung82:week-06
Open

psyoung82 wants to merge 14 commits into
Q00:mainfrom
psyoung82:week-06

Conversation

@psyoung82

@psyoung82 psyoung82 commented Oct 17, 2026 •

Copy link
Copy Markdown

What I built

Codex CLI(codex exec, gpt-6.1-sol)를 하네스로 두고, A2A v1.0(JSON-RPC)만 말하는 가게(seller.py)와 buyer(buyer.py)를 만들었다. 호가·역제안·수락·거절과 제안·포기는 하네스가 JSON 한 줄({"action", "price"})로 정하고, 코드는 A2A 통신과 하한가·예산 가드만 맡는다. trade test 21/21 PASS.

What I tried and discarded

  • trade test는 첫 실행에 21/21 통과했다. 그래서 아래 실패는 전부 실습과 오프라인 검증에서 나왔다. 자세한 내용과 로그 인용은 REPORT.md 3절에 있다.
  • 실습 STEP 5: 빈 변수로 보낸 task id. T=<task id>를 꺾쇠까지 그대로 적어 변수가 비었고, --task-id 80처럼 숫자가 id 자리로 들어가 A2ACLI_ERR_USAGE, exit code 2가 났다. 노트가 예고한 exit 1과 달라서 원인을 찾았다. 실패한 로그는 lab/logs/lab-cli.txt에 그대로 두었다. 이 일 때문에 buyer는 사람이 id를 복사하지 않고, 응답의 task.id를 다음 요청의 taskId에 바로 넣는다.
  • STEP 6: 0바이트 로그. a2a send ... | tee가 stderr를 놓쳤다. 2>&1을 붙여 다시 받았다. 그 뒤로 모든 로그에 [buyer]/[seller]/[harness] 접두어를 붙여 한 파일로 모아도 구분되게 했다.
  • 포트 충돌. 가게를 두 번 띄워 [Errno 48] address already in use가 났다. 다른 창에서 이미 떠 있던 프로세스를 lsof로 찾아 껐다.
  • "한도는 프롬프트에만" 방식은 버렸다. 판단 테스트가 3회씩 돌고 한 번만 틀려도 실패하기 때문에 코드 가드를 더했다. Codex를 부르기 전에 일부러 틀린 답을 내는 가짜 harness로 HTTP 연결을 검증했다. 호가 200, 230 수락, 예산 초과 280을 넣었더니 코드가 각각 260으로 올림, 260 역제안으로 바꿈, 230으로 깎음으로 처리했다. 실제 trade test에서는 가드가 한 번도 발동하지 않았다(로그에 guard: 줄 없음).
  • 하네스가 쓴 문장을 그대로 보내지 않는다. trade test가 호가를 "마지막 숫자"로 읽기 때문에, 상대에게 가는 문장은 코드가 Counteroffer: <price>. 형식으로 만든다.

How to run

  • 하네스: Codex CLI 0.162.1, ChatGPT 로그인. 모델 gpt-6.1-sol(~/.codex/config.toml).
  • 환경변수와 API 키는 필요 없다. Codex 로그인으로 동작한다.
  • 의존성: pip install "a2a-sdk[http-server]" uvicorn httpx
  • 하네스 호출: codex exec --skip-git-repo-check --ephemeral -s read-only --color never -C <빈 임시 폴더> -o <답 파일> - (프롬프트는 stdin)
  • agent.json: 가게 python seller.py --port {port}, buyer python buyer.py --url {url} --item {item} --budget {budget}
python scripts/trade_test_week06.py submissions/25622005/week-06
python scripts/check_week06.py submissions/25622005/week-06

Additional Test

Seller Agent를 인터넷으로 연결하여 테스트할 수 있게 아래와 같이 구성하였다.

테스트 방법(둘 중 하나):

# 이 저장소의 buyer로
python buyer.py --url https://conf-comfortable-prefix-intensity.trycloudflare.com/ --item lamp --budget 120

# a2a CLI로 직접
a2a send -a https://conf-comfortable-prefix-intensity.trycloudflare.com/ "I want to buy a lamp"
a2a send -a https://conf-comfortable-prefix-intensity.trycloudflare.com/ --task-id <위 응답의 task id> "110"

테스트 결과 예시 (lamp, 예산 120).

[buyer] card: 'Codex Shop' binding=JSONRPC v1.0 url=https://conf-comfortable-prefix-intensity.trycloudflare.com/
[buyer] <- TASK_STATE_INPUT_REQUIRED | lamp: asking 130. Send your offer as a number.
[buyer] <- TASK_STATE_INPUT_REQUIRED | 65 is too low. Counteroffer: 120.
[buyer] <- TASK_STATE_COMPLETED | Deal: lamp at 120.
[buyer]    artifact receipt: [{'item': 'lamp', 'price': 120.0, 'seller': 'Codex Shop'}]
[buyer] done: TASK_STATE_COMPLETED after 26s

Checklist

  • python scripts/check_week06.py submissions/25622005/week-06 passes locally (skip for roster PRs)
  • Run logs are committed under logs/
  • No API keys anywhere in the diff
  • History is not squashed

psyoung82 and others added 14 commits October 13, 2026 19:30
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…otes

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d canceled; two usage errors from an empty task-id var kept as is

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eckpoints reached

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… one JSON answer

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…sk/counter/accept/reject; code guards the reserve

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ntinues by taskId; harness decides offers, code guards the budget

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…and offline checks, what A2A settled

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… address when served from my laptop; default unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ted at run time, not baked) and seller --host; not built yet, docker is not installed here

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…login mounted from ~/.codex-docker; not run yet, docker is not installed here

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…udflare quick tunnel for the grader, with the remote buyer run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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