Repository navigation
Agent loop + resilience hardening (Phase 7–8) - #10
Merged
Merged
Conversation
- Introduced a new PortInUseError class to handle port conflicts more gracefully. - Updated cmd_serve to catch PortInUseError and return a specific exit code for port conflicts. - Enhanced GatewayService to raise PortInUseError when the configured port is already in use, improving error clarity. - Added a regression test to ensure that attempting to serve on an occupied port raises the new exception and logs the appropriate error message.
- Introduced a new case in ScriptedActivityService to handle a large activity feed with ~10,000 items for resilience auditing. - Added a static method to generate synthetic JSON data for testing purposes. - Updated project configuration to include ResilienceUITests, which automates UI testing for the new large activity feed. - Enhanced documentation to reflect the automation of UI tests for resilience scenarios, ensuring smooth scrolling and performance verification.
- Added a new section in README.md detailing the native macOS app features, including menu-bar presence, voice overlay, and activity management. - Updated AppModel to ensure the state database is pinned under Application Support for shipped apps, preventing reliance on the process current working directory. - Enhanced DaemonConfiguration to include a stateDatabaseURL parameter, ensuring proper environment variable setup for the state database. - Added unit tests to verify that the state database environment variable is correctly set for bundled configurations, improving reliability in deployment.
- Introduced new tests to validate authorization behavior for protected and exempt routes in GatewayService. - Defined _PROTECTED_ROUTES and _EXEMPT_ROUTES to establish a clear source of truth for route authorization. - Added assertions to ensure that protected routes deny access by default and that exempt routes are accessible without a token. - Implemented a test to catch accidental exemptions of protected routes, enhancing security and review processes.
Upgrade the agent's flat ReAct loop into a two-level loop so Iris can
tackle complex multi-step requests and recover when it gets stuck.
- Plan-aware planner: the first planning turn can return a {"type":"plan",
"subgoals":[...]} shape, so the model judges complexity with no separate
decomposition call and no lexical heuristic. A simple request's triage
turn is seeded as the first step, keeping it to one planner call.
- Sub-goal orchestration in AgentExecutor.run() (_triage_plan /
_invoke_planner / _run_subgoal / _finalize), bounded by per-sub-goal and
global step budgets.
- Stuck detection (repeated action / no visible progress) with an
escalate-then-ask-early ladder: inject a _stuck_signal to push the
planner to a different approach, then stop with a "blocked" message
(maps to the resumable background task status) once escalations run out.
- New pure-logic module agent_loop.py (Plan/SubGoal, coerce_subgoals,
normalize_call, observation_signature, detect_stuck) + 12 tests.
Surface is the deep + background paths only; live Realtime voice stays a
single-tool shim to protect barge-in latency. Backward compatible:
single-sub-goal runs behave as before, plus graceful stuck exits.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five commits on top of the last
desktop-macosmerge (#9): resilience/security hardening for the gateway and the new deliberate agent loop.a38bd29—PortInUseError: the daemon refuses to silently port-hop, logsgateway.port_in_use, and exits cleanly (code 2) instead of dumping a rawOSError.8bcca9b— large (10k-item) activity feed generation +ResilienceUITests(overlay/menu recovery destinations + scroll perf).31e9a35— macOS app support & configuration management (pins shipped daemon state under Application Support).477ba4e— deny-by-default authorization tests forGatewayService(locksAUTH_EXEMPT_PATHS; every other route must reject missing/wrong tokens).2a0d967— deliberate agent loop (detail below).Highlight: deliberate agent loop
Upgrades the agent's flat ReAct loop into a two-level loop so Iris can tackle complex multi-step requests and recover when it gets stuck:
{"type":"plan","subgoals":[…]}shape, so the model judges complexity (no lexical heuristic, no separate decomposition call). A simple request's triage turn is seeded as its first step, keeping it to one planner call._triage_plan/_invoke_planner/_run_subgoal/_finalize, bounded by per-sub-goal and global step budgets._stuck_signalto push a different approach, then stops with a "blocked" message (resumable background-task status) once escalations run out.src/iris/agent_loop.py+tests/test_agent_loop.py.Surface is the deep + background paths only; live Realtime voice stays a single-tool shim to protect barge-in latency. Backward compatible — single-sub-goal runs behave as before, plus graceful stuck exits.
Testing
uv run pytest— 278 passeduv run ruff check ./ruff format— cleanNotes
mainhas since merged a couple of unrelated PRs (CLI error messages, live-interruptions) not on this branch — it shows as diverged (behind by 5). Flag any merge conflict incli.py(both touched CLI error paths).implementation/desktop-macos-plan.md(gitignored, local only).🤖 Generated with Claude Code