Skip to content

An example app built on the CLI and the socket alone - #666

Merged
lydakis merged 3 commits into
mainfrom
claude/project-thread-7zb8yg
Nov 2, 2026
Merged

lydakis merged 3 commits into
mainfrom
claude/project-thread-7zb8yg

Conversation

@lydakis

@lydakis lydakis commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Requested by George · project thread

Option B from the Pi review: one small app outside Sonny, built only on the agent CLI's JSON output and the daemon's JSONL socket, to measure what it takes to build on Agent.

What's here

  • examples/triage/triage.py is an issue-triage service in standard-library Python. A template bot has no tools of its own and two declared tools, search_issues and set_triage, which the app answers (answered_by). Each issue goes to its own fork through run --fork --detach --request-id. The app collects the results with wait, 64 handles at a time, and exits 1 if any triage does not complete. A rerun updates the template's model, instructions and tools.
  • examples/triage/offline.sh runs it against scripted_model.py, a local Responses endpoint with scripted words, so it needs no key. It runs in a throwaway store and socket. Everything else is real.
  • tests/test_examples.py runs offline.sh in the runtime suite. If a protocol change breaks the app, CI fails.
  • examples/triage/README.md records what it took, measured at 7ea7b7a (protocol 48):
    • 109 code lines. 28 are the app itself and 81 connect it to Agent. The socket session is 17 lines, the template setup 8 and the answer loop 19.
    • Eleven protocol facts the author had to know. Seven of them are about answering declared tools.
    • Three gaps, each with a proposed fix:
      1. Declaring tools needs the socket. Fix: run --new --declare FILE (CLI only).
      2. Answering needs the socket and a loop that is easy to get wrong. Fix: two CLI commands over tool_calls and tool_result, as approvals and answer are for gates (CLI only).
      3. workspace_required comes with detail: null and arrives late, at the first fork's turn rather than at create. Fix: a detail and a CLI hint. This one is a daemon text change.

This PR implements none of the fixes. They wait for George's call.

There are no daemon changes. The one top-level README line links the example.

Checks

  • AGENT_TEST_RUNTIME=1 python3 -m unittest tests.test_examples passes against a release build. The test takes 0.46 s.
  • offline.sh with AGENT_SOCKET pointed elsewhere still uses only its own daemon.
  • A rerun on the same store with another AGENT_MODEL moves the template to that model, as inspect shows.
  • A one-off run checked the backlog path. All five turns parked on their first call before the app started listening, and all five completed once it did.

🤖 Generated with Claude Code

https://claude.ai/code/session_013jkdGGf29tQRUx1AhX6DWy

examples/triage is a small issue-triage service, written the way an outside
program would build on Agent: the agent CLI's JSON and the daemon's JSONL
socket, no SDK and nothing from Sonny. Each issue goes to a fork of a
template bot whose only tools are two the app declares and answers
(search_issues, set_triage).

offline.sh runs it against a scripted Responses endpoint, and
tests/test_examples.py runs that in the runtime suite, so a protocol change
that breaks an adopter's app fails CI. The example's README records what it
took (102 code lines, 74 of them integration, and eleven protocol facts) and
the three gaps it hit, each with a proposed fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jkdGGf29tQRUx1AhX6DWy
@lydakis lydakis self-assigned this Nov 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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 ✅ Completed 2026-11-02T12:25:31.295265Z f087476 New commits
🔒 Security Review ✅ Completed 2026-11-02T12:14:33.864602Z 8e2c943 PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e2c94377c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread examples/triage/offline.sh Resolved
Comment thread examples/triage/triage.py Resolved
Comment thread examples/triage/triage.py Resolved
…t 1 on a failed turn

offline.sh sets AGENT_SOCKET in its throwaway folder, so an inherited
socket override can no longer point it at, and its trap shut down, the
caller's own daemon. triage.py waits on at most 64 handles at a time, as
the protocol's wait allows, and exits 1 when any triage did not complete.
The README's counts follow (108 code lines, 80 of them integration) and
its facts now say that a wait takes 64 handles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jkdGGf29tQRUx1AhX6DWy

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd1d8e71d8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread examples/triage/triage.py Resolved
Comment thread examples/triage/triage.py Resolved
…it reports pending

configure now sends AGENT_MODEL with the instructions and tools, so a
template made by an earlier run takes the model this run names. A handle the
wait timed out on comes back as {"pending": true} with no status; the app
reads it as pending instead of failing on the missing field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jkdGGf29tQRUx1AhX6DWy
@lydakis
lydakis merged commit 44b5ed9 into main Nov 2, 2026
9 checks passed
@lydakis
lydakis deleted the claude/project-thread-7zb8yg branch November 2, 2026 12:42
@lydakis lydakis mentioned this pull request Nov 5, 2026
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