Skip to content

test(agent): cover inherited invoke tools - #3595

Merged
kwakayama merged 3 commits into
mainfrom
test/issue-476-invoke-agent-contract
Aug 11, 2026
Merged

test(agent): cover inherited invoke tools#3595
kwakayama merged 3 commits into
mainfrom
test/issue-476-invoke-agent-contract

Conversation

@kwakayama

@kwakayama kwakayama commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • cover omitted invoke_agent context on the generic hosted child path
  • assert assembled local tools are inherited by the child
  • assert get_file reaches a grandchild runtime

Verification

  • deno fmt --check passed
  • deno lint passed
  • git diff --check passed
  • local target execution is blocked before tests by the existing node:util/types brand-check runtime incompatibility
  • the pre-push type check is blocked by existing React 19 default-export and Node timeout errors on main; pushed with --no-verify for canonical CI coverage

Tracks veryfront/veryfront-issue-inbox#476.

Summary by CodeRabbit

  • Tests
    • Added coverage for local child execution without child-agent configuration.
    • Verified inherited tools, the standard sleep tool, successful completion, and recorded tool names.
    • Expanded nested delegation coverage to confirm inherited file-access tools are available to grandchild agents.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 75b0c46f-8708-4bbc-8186-0883de809af7

📥 Commits

Reviewing files that changed from the base of the PR and between 47616a5 and 97c5478.

📒 Files selected for processing (1)
  • src/agent/hosted/default-invoke-agent-tool.test.ts

📝 Walkthrough

Walkthrough

The pull request adds BDD test coverage for generic child execution and nested delegation. The tests verify context propagation, assembled tools, runtime completion, and inherited tool visibility.

Changes

Child-agent tool inheritance

Layer / File(s) Summary
Generic child execution coverage
src/agent/hosted/default-invoke-agent-tool.test.ts
Converts existing child-agent tests to BDD declarations and adds coverage for a generic child without execution settings. The new test verifies context propagation, assembled tools, successful completion, lookup_job, and sleep.
Nested delegation coverage
src/agent/runtime/delegate-remote-tool-context.test.ts
Records grandchild runtime tool names and verifies inherited get_file availability.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kojiwakayama

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the tests added for inherited agent invocation tools.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/issue-476-invoke-agent-contract

Comment @coderabbitai help to get the list of available commands.

@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: 47616a50cc

ℹ️ 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 src/agent/hosted/default-invoke-agent-tool.test.ts Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/agent/hosted/default-invoke-agent-tool.test.ts`:
- Line 269: Replace the Deno.test registration for the generic local child
inheritance test with the repository BDD API, importing describe and it from
`#veryfront/testing/bdd.ts` and nesting the test under describe/it so it runs
across all supported runtimes.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 92cb3451-ef10-456a-9504-cb1763ff9991

📥 Commits

Reviewing files that changed from the base of the PR and between 07683f1 and 47616a5.

📒 Files selected for processing (2)
  • src/agent/hosted/default-invoke-agent-tool.test.ts
  • src/agent/runtime/delegate-remote-tool-context.test.ts

Comment thread src/agent/hosted/default-invoke-agent-tool.test.ts Outdated
@kwakayama

Copy link
Copy Markdown
Contributor Author

Codex review — full SHA 97c54785cd26236bdf788bf8196beff541cc91bd

Findings (severity order): none actionable.

Evidence:

  • src/agent/hosted/default-invoke-agent-tool.test.ts:270-350 covers the generic/no-child-config path with omitted input context, verifies the scoped invocation context, and proves the assembled lookup_job plus standard sleep names reach the fork runtime.
  • The hosted test file now uses the repository BDD API throughout, eliminating the Deno. source heuristic that excluded it from Node/Bun; canonical CI passed Deno unit/coverage, Node, and Bun.
  • src/agent/runtime/delegate-remote-tool-context.test.ts:300-438 verifies the trusted Studio source is listed under the grandchild identity and that get_file is present in the grandchild runtime. The adjacent regression at lines 155-279 separately executes the inherited tool and verifies parent credential/run identity, so another execution assertion in the nested test would duplicate the already-covered execution seam rather than expose a missing inheritance contract.

Verification:

  • Pinned diff 07683f13497c4d2cf7359fd7bee4e7679bb64527...97c54785cd26236bdf788bf8196beff541cc91bd reviewed; 2 test files only.
  • Focused Node: 13/13 passed. Modified-file format, lint, and git diff --check: passed.
  • GitHub: 27 passed, 0 failed/pending, 6 workflow-conditional skips; 0 unresolved threads; PR is non-draft and mergeable.
  • Local gaps: the focused Deno process hit the checkout's pre-existing preload/setup failure, and the focused Bun runner collided with an existing node_modules/veryfront link. Direct deno check reached only the known React 19 default-export errors in react/react.ts. Canonical CI passed typecheck and all three runtime suites for this SHA.

Verdict: APPROVE
Score: 97/100

Review-Gate:
Reviewer: Codex
Reviewed-SHA: 97c5478
Score: 97/100
Actionable-Findings: 0
Verdict: APPROVE

@kwakayama

Copy link
Copy Markdown
Contributor Author

Review follow-up: the remaining CodeRabbit docstring warning is not actionable for this diff. The PR adds and converts test registrations only; it introduces no callable production functions, and the existing createTestOptions helper predates the PR. Adding docstrings to anonymous test callbacks or unrelated existing test helpers would not improve the public contract. All inline findings are fixed and resolved, and the portable BDD tests pass under Deno, Node, and Bun.

@kwakayama
kwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 632af61 Aug 11, 2026
33 checks passed
@kwakayama
kwakayama deleted the test/issue-476-invoke-agent-contract branch August 11, 2026 18:53
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