Skip to content

Tools: run_code sandbox, GitHub and Linear built in - #13

Merged
Taskmaster-1 merged 8 commits into
mainfrom
feat/tools-4
Oct 31, 2026
Merged

Taskmaster-1 merged 8 commits into
mainfrom
feat/tools-4

Conversation

@Taskmaster-1

Copy link
Copy Markdown
Owner

Three more tool groups, all on the existing approval and policy rules.

run_code: exact arithmetic and data work

  • JavaScript runs in QuickJS compiled to WebAssembly (quickjs-emscripten@0.32.0, pinned), inside a Bun Worker so a long loop can't block the server.
  • No network, filesystem, timers or host objects. Limits: 5 s, 64 MB memory, 512 KB stack, and 20k characters of output. Each call starts a fresh context.
  • Helpers:
    • files: the text of the user's own attached files.
    • csv(): a CSV parser.
    • saveFile(): saves results as files you can email.
  • Effect read. A call that reads files taints the run, because file content can steer what happens next. A pure calculation does not. Core now has an optional per-call taints(input) on ToolDefinition to support this. Addresses in the output still never count as recipients the user named.
  • The prompt tells the agent to use it rather than doing arithmetic in its head.

GitHub, built in

  • OAuth with PKCE and scopes repo and read:org. It reuses GITHUB_CLIENT_ID/SECRET by default, or a separate GITHUB_TOOLS_* app. Disconnecting revokes the token; with a dedicated app it revokes the whole grant.
  • Read tools:
    • github_search
    • github_read: an issue or PR, with files, reviews, checks and comments.
    • github_my_work: review requests, assigned items and your open PRs.
    • github_read_file
  • Approval required: github_comment, github_create_issue, github_update_issue.
  • Risk facts:
    • "Comments as you on o/r#n"
    • "Notifies N people by @mention"
    • "Closes o/r#n as you"
  • A repo the agent only saw in something it read is flagged as a new destination. Errors are mapped for 401 (reconnect), rate limits (reset time) and 404.

Linear, built in

  • OAuth with PKCE and scopes read,write. Access tokens last 24 h and the refresh token rotates on each use. A revoked grant sets needs_auth. Disconnecting revokes both tokens.
  • Read tools: linear_search, linear_read, linear_my_issues, and linear_list_teams (trusted ids and names).
  • Approval required: linear_create_issue, linear_update_issue (adds or removes labels, never replaces the whole set), linear_comment.
  • Team, state, label and assignee names are resolved to ids when the tool runs.
  • Destinations: team and issue count as targets, so a team only seen in something the agent read is flagged.

Checks

  • 381 tests pass; lint, typecheck and the web build pass.
  • In the browser, against fake GitHub, Linear, Google and Slack: the GitHub comment card (mention fact), the Linear issue card, a run_code task finishing without asking, and Connections at 390 px.
  • Not run against real GitHub or Linear. Unverified: GitHub callback URL matching and the revoke endpoints, and Linear's error codes for revoked tokens.
  • Setup docs: docs/github.md and docs/linear.md.

…d data work

The agent runs code in QuickJS compiled to WebAssembly, on a worker thread, with a fresh
runtime per call: no network, disk, timers or host objects; 5 s, 64 MB, stack and output
limits. Attached text, CSV, JSON and PDF files are exposed as `files` with a csv() helper,
and saveFile() stores a private result file whose id comes back. A read whose output counts
as untrusted. The task view shows the result, printed output and saved files.
…eate, update and comment with approval

Linear OAuth 2 with PKCE and rotating refresh tokens, sealed in the integrations table;
a revoked grant flips to needs_auth and withholds the tools. Seven tools over GraphQL with
injectable fetch; team and issue fields count as destinations for the read-never-widens-
the-write check. Connections card, approval views for new issues and comments, risk facts,
a fake Linear for tests, docs/linear.md.
…file issues as you

- Connect from Connections with the GitHub OAuth app (sign-in app or GITHUB_TOOLS_* override),
  scopes repo and read:org, PKCE, token sealed in integrations; disconnect revokes at GitHub
- Tools: github_search, github_read (PR files, reviews, checks), github_my_work,
  github_read_file, github_comment (send), github_create_issue, github_update_issue (write)
- 401 marks the connection needs_auth; rate limits report the reset time; 404 says not found
  or no access
- Risk facts for GitHub writes, repo destination test, approval views for comments and issues
- Fake GitHub, unit and end-to-end tests; docs/github.md, API docs, README
# Conflicts:
#	README.md
#	apps/server/src/app.ts
#	apps/server/src/config.ts
#	apps/server/src/routes/integrations.ts
#	apps/server/src/services.ts
#	apps/server/src/worker.ts
#	apps/web/app/(app)/connections/page.tsx
#	apps/web/components/approval/payload.tsx
#	apps/web/lib/api.ts
#	docs/api.md
#	packages/core/src/risk.test.ts
#	packages/core/src/risk.ts
#	packages/db/src/schema.ts
#	packages/tools/package.json
#	packages/tools/src/index.ts
@Taskmaster-1
Taskmaster-1 merged commit 4e26904 into main Oct 31, 2026
1 check 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