Skip to content

Add keyless web research tools#49

Merged
agjs merged 4 commits into
mainfrom
codex/keyless-web-research
Jun 26, 2026
Merged

Add keyless web research tools#49
agjs merged 4 commits into
mainfrom
codex/keyless-web-research

Conversation

@agjs

@agjs agjs commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What changed

  • Expanded TSFORGE_WEB=1 from web_fetch/web_search into a keyless research surface:
    • package_info for npm registry metadata, dist-tags, versions, deprecation status, peer deps, homepage, and repository.
    • package_docs for local node_modules package docs/types first, falling back to npm registry README.
    • web_browse for local Playwright/Chromium rendered page reads without a hosted browser service.
  • Upgraded web_search with recency, domains, maxResults, public-result filtering, and optional SearXNG backend selection.
  • Updated prompt guidance so agents choose the right research ladder before installing packages or guessing current APIs.
  • Updated docs to describe the no-required-API-key/no-paid-service posture.

Why

Agents need current package versions, package documentation, and browser-like web access without coupling tsforge users to paid search APIs, hosted browser backends, or required third-party service keys.

Validation

  • bun run validate
  • Targeted checks:
    • bun test packages/core/tests/package-info.test.ts packages/core/tests/web-browse.test.ts packages/core/tests/web-search.test.ts packages/core/tests/tools-gating.test.ts packages/core/tests/execute-tool.test.ts packages/core/tests/policy-evaluation.test.ts packages/core/tests/prompt-conventions.test.ts
    • bun run typecheck
    • bun run lint

@agjs agjs changed the title [codex] Add keyless web research tools Add keyless web research tools Jun 26, 2026
@agjs agjs marked this pull request as ready for review June 26, 2026 14:53

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces keyless web and package research capabilities to tsforge, adding new tools such as package_info and package_docs for npm registry and local documentation lookups, and web_browse for rendering JavaScript-heavy pages via local Playwright/Chromium. It also enhances the existing web_search tool with recency, domain scoping, and result limit options. The feedback highlights several robust improvements, including resolving semver ranges and major versions in package_info, supporting monorepo hoisting via require.resolve, adding optional chaining to prevent crashes on blank pages in web_browse, and gracefully skipping invalid domains in web_search instead of failing the entire query.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/core/src/loop/tools/package-info.ts
Comment thread packages/core/src/loop/tools/package-info.ts Outdated
Comment thread packages/core/src/loop/tools/web-browse.ts
Comment thread packages/core/src/loop/tools/web-search.ts
agjs added 3 commits June 26, 2026 16:59
…earch

# Conflicts:
#	packages/core/tests/execute-tool.test.ts
The 'recent' versions list and the no-dist-tag 'latest' fallback derived
from Object.keys(versions).sort() — a lexical sort that misorders semver
(1.10.0 < 1.9.0 as strings). package_info exists to give the model
current-version awareness, so a misordered recent list / wrong fallback
latest undercuts its purpose. Add a numeric component-wise comparator
(prerelease ranks below its release) used for version ordering only;
dependency-name lists keep alphabetical order.
…po hoisting, secret-safe types read, null-body guard

- package_info: resolve a requested dist-tag / major / range (react@19,
  ^19.0.0, ~19.1) to a concrete version key before lookup, so dependency
  and peerDependency lists are no longer empty for non-exact specs.
- package_docs: walk up parent node_modules so hoisted monorepo deps
  resolve (was cwd/node_modules only); avoids require.resolve's
  exports-blocked package.json subpath pitfall.
- package_docs: clamp the package.json `types` read to the package root
  so a hostile installed dep can't disclose ../../../etc/passwd.
- web_browse: read body text via a nullable lookup so a blank/failed page
  yields "" instead of a TypeError.

Tests cover major/caret resolution, ancestor-node_modules hoisting, and
the types-escape refusal.
@agjs agjs merged commit e638daa into main Jun 26, 2026
8 checks passed
@agjs agjs deleted the codex/keyless-web-research branch June 26, 2026 17:38
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