Fix: drop redundant "browser" prune from scripts/check_license.sh - #594
Open
AmaadMartin wants to merge 1 commit into
Open
Fix: drop redundant "browser" prune from scripts/check_license.sh#594AmaadMartin wants to merge 1 commit into
AmaadMartin wants to merge 1 commit into
Conversation
find evaluates -prune against each directory's basename as it descends, so dev/dist is pruned before dev/dist/browser is ever reached. The dist prune alone already excludes the vendored ADK Web assets that the browser clause was meant to skip, making the clause dead for every directory the repository contains or its build produces. Verified on a fully built tree (node_modules installed, dev/dist/browser populated with 101 unlicensed vendor .js files): the four-prune and three-prune file lists are byte-identical at 545 paths, and the script's stdout and exit status are unchanged. Removing the clause also closes a gap: a first-party source directory named browser outside a pruned subtree would previously have been exempted from the license check, which is the opposite of the check's purpose.
AmaadMartin
pushed a commit
that referenced
this pull request
Aug 6, 2026
…7) (#594) * feat(tools): add FunctionTool require_confirmation (human-in-the-loop approval) Part 7/9 of the feature/workflows split. - tools/function_tool: a `requireConfirmation` option so a FunctionTool pauses for human approval before executing. - agents/processors/request_confirmation_llm_request_processor: handles the confirmation request/resume round-trip for such tools. This tool-approval HITL is independent of the workflow engine (it works for any FunctionTool), so it is a small, self-contained slice. Tests: tools/function_tool_confirmation_test (5). Full core suite green (2481), docs:check + tsc clean. * fix(tools): gate and harden plain-text tool confirmation (PR #594) Addresses the security/API review on FunctionTool require_confirmation: - The plain-text confirmation fallback no longer runs on every LlmAgent invocation. It is now opt-in via a new `RunConfig.plainTextToolConfirmation` flag (default off), which the interactive `adk run` CLI sets — so on a web/API surface an ordinary chat message is never silently reinterpreted as a tool-gate decision. The structured FunctionResponse path is unchanged. - Harden the fallback itself: resolve only the SINGLE most-recent pending confirmation (never a broadcast across every unanswered gate), require the reply to IMMEDIATELY follow the request (no intervening user turn), and treat unrecognized text as NO decision — the gate stays pending instead of being silently denied (only explicit negatives deny). - Extract a `RequireConfirmation<TParameters>` type with a `toolContext` (not snake_case `tool_context`) parameter, reuse it for both the option and the field, and export it from common.ts. - Correct the `requireConfirmation` doc: the HITL gate is enforced on the LlmAgent path; a workflow ToolNode does not yet route through it (it returns the "requires confirmation" error as node output rather than pausing). - Inline the redundant `await` in runAsync and drop the stale comment. * test(tools): cover the confirmation resume round-trip (PR #594) - Add end-to-end tests that drive a session event list back through RequestConfirmationLlmRequestProcessor with a real LlmAgent + real FunctionTool (no mocks) and assert the original tool is actually re-invoked with the right decision — the step where an id mismatch on resume would show up, and the first coverage of the plain-text fallback: opt-in gating, single-gate binding, unrecognized-text-stays-pending, and no cross-gate broadcast. - Replace the `agent: ... as never` fixture with a real LlmAgent instance so it breaks if InvocationContext's contract changes.
This was referenced Aug 6, 2026
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
No existing issue; description below.
Problem:
scripts/check_license.shprunes four directory names while building its candidate file list, and one of them is dead code:The
-name "browser"clause was present in the script's first revision ("Add license check workflow",97d92bbd) and has never been touched since. It was there to keep the downloaded ADK Web assets out of the license-header check. Those assets are extracted byensureBrowserAssets()indev/build.jstodev/dist/browser.findevaluates-pruneagainst each directory's basename as it descends. Descending from the repo root it reachesdev/distfirst, prunes it on thedistclause, and therefore never descends intodev/dist/browserat all. Thedistprune alone already excludes every ADK Web asset, so thebrowserclause excludes nothing that the surviving prunes do not.Leaving it costs two things: a future reader believes the clause is load-bearing, and — more importantly — it is redundant, not a universal no-op. A directory named
browseroutside a pruned subtree (for example a first-partydev/src/browser) would be silently exempted from the license check, which is the exact opposite of what the check exists to do.Solution: Delete the single
-o -name "browser"clause. One file, one line; every other token in the script — the shebang, the banners, the Perl slurp regex, theMISSING_FILESaccumulation, the exit codes, the second line's indentation and escaping, and the file mode (100644) — is byte-identical.Deliberately not included in this PR, to keep the diff at one line:
finditself errors out (it never inspectsfind's exit status, so a mangled expression yields an empty list and a false green). That is a real but separate defect and is out of scope here; addingset -euo pipefailor a find-exit-status guard would turn a one-line deletion into a behavior change.eslint.config.jsand.prettierignorestill carry staledev/src/browserignore entries. They are untouched here — a separate change removes those, and editing them in this PR would conflict.Collision check: before starting, I listed all 493 open PRs on the fork (
gh pr list --repo AmaadMartin/adk-js --state open --limit 1000) and scanned every fork branch's history for commits touching this file (git log fork/main..<branch> -- scripts/check_license.shover all remote refs). No open PR and no fork branch modifiesscripts/check_license.sh; the only commit in its history is the one that introduced it. The nearest neighbours were checked by file list and do not overlap: #454 touches only.prettierignoreandeslint.config.js, #553 touches the build-time license banner incore/build.js/integrations/build.js, and #426 toucheseslint.config.jsplus code files.Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
[x] I have added or updated unit tests for my change.
No unit test file was added, and this is a deliberate, stated choice rather than an omission. The change adds zero lines of executable code — it deletes one clause from a Bash
findexpression. The repo has no shell-script test harness: every project invitest.config.ts(unit:core,unit:dev,unit:integrations,integration,e2e,cross-language) includes only**/*_test.ts. A Vitest spec that shells out tocheck_license.shwould be a multi-minute, build- and network-dependent test guarding a line that CI already executes on every push and PR. The standing regression gate is the existingLicense Header Checkworkflow, which is this script's only caller (.github/workflows/license-check.yml:18,bash scripts/check_license.sh); nothing else in the repo references it and nopackage.jsonscript invokes it. Verification below is therefore behavioral and was executed by hand.[x] All unit tests pass locally.
Manual End-to-End (E2E) Tests:
Please provide instructions on how to manually test your changes, including any necessary setup or configuration.
All of the following were run from the repo root on a fully built tree (
npm install && npm run build, which downloadsadk-web-browser.zipand extracts it), because a built tree is the only case where the pruned directory actually exists.1. Premise — nothing named
browserexists outside a pruned subtree:2. Behavior is unchanged — stdout, exit status, and the file list:
File lists compared directly (4-prune before vs 3-prune after, both sorted):
The list count matters as much as the empty diff: an empty list would also produce a passing script, so a green run alone does not prove the
findexpression survived the edit. 545 paths, unchanged, does.3. CI-equivalent run on a bare checkout. The workflow runs on
actions/checkoutwith no build step, sodev/distdoes not exist there. Reproduced by cloning to a scratch dir and copying in the edited script:4. Mutation proof A — the surviving prunes are load-bearing. Dropping
distas well (i.e. mutating the line further than this PR does) makes the assets reappear:So those 101 files genuinely lack license headers and genuinely need a prune — and
distis the clause providing it. Reverted immediately.5. Mutation proof B — the deleted clause was not a no-op in the dangerous direction. This is the proof that the change is observable at all, since proofs 2–4 are all equality checks. I created an unlicensed first-party source file at
dev/src/browser/probe.ts(abrowserdirectory outside any pruned subtree) and ran both versions of the script against it:The old script's false green on an unlicensed first-party file is the gap this PR closes. The probe file was deleted afterwards and is not part of the diff.
6. Diff hygiene:
(
npm installdid not perturbpackage-lock.json.)7. CI.
check-license(the workflow that runs this script — the direct regression gate) passed, and the real test jobsrun-testsandrun-testsonubuntu-latest,macos-latestandwindows-latestall passed. On the first attemptmacos-latestfailed with a timeout intests/integration/app_loader/app_loader_test.ts > "should discover apps vs agents across directories and standalone files"; that is a known intermittent flake on the macOS/Windows runners, is unrelated to a one-line shell-script edit that no TypeScript test loads, and the job passed on re-run with no code change.Checklist
[x] I have read the CONTRIBUTING.md document.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.