feat(agent): add price watcher demo agent with HTTP hostcall#25
feat(agent): add price watcher demo agent with HTTP hostcall#25simonovic86 merged 1 commit intomainfrom
Conversation
Add a new demo agent that fetches BTC/ETH prices from CoinGecko via the HTTP hostcall, tracking high/low/latest across checkpoint/resume cycles. Increase tick timeout from 100ms to 15s to accommodate HTTP requests. Includes build targets, demo script, and updated docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5ccc687b0
ℹ️ 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".
| // Used by agent execution, replay verification, and the simulator. | ||
| const TickTimeout = 100 * time.Millisecond | ||
| // Set to 15s to accommodate agents making HTTP requests during ticks. | ||
| const TickTimeout = 15 * time.Second |
There was a problem hiding this comment.
Keep default tick timeout low for non-HTTP paths
Raising config.TickTimeout to 15s makes every hung agent_tick block far longer across normal execution, replay, and simulation (internal/agent/instance.go:400, internal/replay/engine.go:163, internal/simulator/simulator.go:245). In practice, any buggy or malicious agent that spins or deadlocks can now occupy execution for up to 15s per tick, which weakens the existing timeout safeguard and noticeably hurts liveness for agents that do not perform HTTP calls. A safer approach is to keep the global tick bound short and apply longer limits only where HTTP work is actually needed.
Useful? React with 👍 / 👎.
Summary
Adds a new price watcher demo agent that fetches cryptocurrency prices from CoinGecko API, demonstrating portable agents with real-world HTTP integration and state persistence across checkpoint/resume cycles.
Changes
New Agent: Price Watcher
agents/pricewatcher/— Demo agent that:Configuration Updates
TickTimeoutfrom 100ms to 15s ininternal/config/config.goto accommodate HTTP requests during agent ticksBuild & Demo Scripts
make agent-pricewatcherbuild targetmake demo-pricewatcherend-to-end demoscripts/demo-pricewatcher.sh— Shows agent running on "Machine A", checkpoint copied to "Machine B", then resumed with continuous stateDocumentation
CLAUDE.mdwith pricewatcher demo description and make target list