Skip to content

feat: api tool agents with settled writes, complete tool calls and redacted records - #99

Merged
abhishekgahlot2 merged 21 commits into
mainfrom
feat/api-tool-agent
Oct 19, 2026
Merged

abhishekgahlot2 merged 21 commits into
mainfrom
feat/api-tool-agent

Conversation

@abhishekgahlot2

@abhishekgahlot2 abhishekgahlot2 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds API tool agents: Anthropic and OpenAI agents that act only through HTTP routes an environment declares, run as offline session tool actions.

  • Environments declare tools (HttpTool/HttpRoute): a fixed loopback origin, method and path, and JSON shape. Requests are sent by a runner executing as the agent user in the offline namespace, with input supplied from a root-only file. Redirects are not followed. Inline session requests cannot declare tools.
  • Every write is held unsettled from dispatch. Grading runs only after the environment's root_tool_settle hook proves the app has finished or dropped every write. Without that proof, the result has no verdict (error_type='unsettled_write'), whatever the score.
  • Step verifiers can't be combined with write tools.
  • Anthropic tool calls run only after a complete response with stop_reason=tool_use; this check also covers the Anthropic computer-use agent. Cut-off, unfinished or unparsable responses are recorded as incomplete, with what arrived, and never acted on.
  • Tool credentials stay root-only and are redacted field by field from every record, including binary bodies. Header credentials and decoded Basic pairs must be ASCII.
  • tools, allowed_actions and root_tool_settle load from environment metadata.

Authoring contract (see docs/agents.md):

  • An environment with write tools needs a real app-settlement hook, and its correctness is the environment's responsibility.
  • Write tools can't use step verifiers.
  • Credential values must be ASCII.
  • A declared GraphQL or JSON-RPC route allows every body operation the app role permits.

Tests:

  • Pre-rebase full suite (-n 4): 2678 passed, 4 failed, 1813 skipped.
  • Post-rebase focused run (tests/test_tools.py, tests/agents): 345 passed, 2 baseline CLI-compat failures, 3 skipped.
  • Full suite not rerun locally after rebase; CI test jobs (Python 3.10, 3.11, 3.12) passed on this head.

Baseline failures, which also fail on main: 2 test_cli_compat checks against the locally installed CLIs, and 2 computer-use suite counts that read ~/.deepgym/environments.

@abhishekgahlot2
abhishekgahlot2 merged commit 798d6e8 into main Oct 19, 2026
6 checks passed
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