Commit Graph

58 Commits

Author SHA1 Message Date
DeWitt Clinton
a769fae655 Reduce noisy logging for missing .geminiignore file. (#793) 2025-06-06 07:47:43 -07:00
Olcan
5a6c1bad69 skip npm build for custom sandbox (#779) 2025-06-05 14:15:43 -07:00
Olcan
d7b59dcb64 use execSync (vs spawnSync) so launch fails if build_sandbox fails; tweaks in build_sandbox to fix some shellcheck warnings, and to simplify the logic slightly (#767) 2025-06-05 13:02:56 -07:00
Eddie Santos
9a7199519e Add support for .geminiignore file (#757) 2025-06-05 10:15:27 -07:00
Tolik Malibroda
c90b7a0a3f fix: Disable automatic image building if BUILD_SANDBOX is not provided (#764) 2025-06-05 18:47:39 +02:00
Tolik Malibroda
95917b22da feat: Add multi-stage docker build support for custom sandbox.Dockerfile (#746) 2025-06-05 17:46:54 +02:00
Jacob Richman
50efcbf241 Jacob314/memory fixes (#754)
Address multiple possible memory leaks found bystatic analysis of the codebase. The primary source of the leaks was event listeners on child processes and global objects that were not being properly removed, potentially causing their closures to be retained in memory indefinitely particularly for processes that did not exit.

There are two commits. A larger one made by gemini CLI and a smaller one by me to make sure we always disconnect child processes as part of the cleanup methods. These changes may not actually fix any leaks but do look like reasonable defensive coding to avoid leaking event listeners or child processes.

The following files were fixed:
This is Gemini's somewhat overconfident description of what it did.

packages/core/src/tools/shell.ts: Fixed a leak where an abortSignal listener was not being reliably removed.
packages/cli/src/utils/readStdin.ts: Fixed a significant leak where listeners on process.stdin were never removed.
packages/cli/src/utils/sandbox.ts: Fixed leaks in the imageExists and pullImage helper functions where listeners on spawned child processes were not being removed.
packages/core/src/tools/grep.ts: Fixed three separate leaks in the isCommandAvailable check and the git grep and system grep strategies due to un-removed listeners on child processes.
packages/core/src/tools/tool-registry.ts: Corrected a leak in the execute method of the DiscoveredTool class where listeners on the spawned tool process were not being removed.
2025-06-05 06:40:33 -07:00
Tolik Malibroda
4770b2fc3c fix: Fix piped input mode in sandbox (#739) 2025-06-04 08:24:33 +02:00
Olcan
7a3a2e9868 fix BUILD_SANDBOX env var for updating sandbox while running linked binary (#729) 2025-06-03 14:02:00 -07:00
Brandon Keiji
05d54f9449 fix: do not try to pull development sandbox image from the internet (#725) 2025-06-03 19:32:17 +00:00
Allen Hutchison
dc25ca81a3 feat(cli): add pro model availability check and fallback to flash (#608) 2025-06-02 13:55:54 -07:00
Tommaso Sciortino
64bd136f42 Rename server->core (#638) 2025-05-30 18:25:47 -07:00
Brandon Keiji
454204cd0f fix(sandbox): pull sandbox image if it doesnt exist locally (#628) 2025-05-30 20:49:47 +00:00
Brandon Keiji
840a2c730f feat(sandbox): use package config to dictate sandbox image name (#624) 2025-05-30 19:28:46 +00:00
Olcan
cdcb7e72cd allow writing to user cache directory on macos (fixes use of lyria mcp server [to generate songs] under seatbelt) (#600) 2025-05-29 15:06:09 -07:00
Olcan
be79843c37 update email to gemini-cli-dev (#510) 2025-05-23 08:35:16 -07:00
Olcan
ccefef9919 allow write to ~/.gitconfig in seatbelt profiles (#509) 2025-05-23 07:56:43 -07:00
Olcan
f02af9cc06 fix HOME in sandbox on cloudtops (linux) (#454) 2025-05-20 15:30:49 -07:00
Olcan
769e7dac8e rename env vars GEMINI_CODE_{MODEL,SANDBOX,SANDBOX_IMAGE} (#411) 2025-05-17 17:28:44 -07:00
Olcan
c540995764 move sandbox-related messages to stderr (#363) 2025-05-15 10:54:30 -07:00
Brandon Keiji
65648a73f4 fix: pass startup warnings to app as prop (#342) 2025-05-13 17:12:04 -07:00
Brandon Keiji
12efd21076 fix(sandbox): default to current user profile for debian/ubuntu env (#337) 2025-05-13 21:13:54 +00:00
Brandon Keiji
c16e16fdd6 refactor: shorten 'gemini' binary name (#329) 2025-05-13 10:49:45 -07:00
Taylor Mullen
de523f1688 Remove terminal tool and dependencies.
- We now solely use the shell tool. This deletes all content around the legacy terminal tool so we can focus on improving the new Shell tool.
- Remove instances from sandboxing, tests, utilities etc.
2025-05-11 12:35:55 -07:00
Olcan
cabcdda449 sandbox/seatbelt-aware system prompt, support for custom seatbelt profiles under project settings (#304) 2025-05-09 11:33:05 -07:00
Olcan
d80e7b55e7 fix MCP under seatbelt, improve error handling (#301) 2025-05-09 09:02:14 -07:00
Olcan
bed75851e9 fix debugging with seatbelt, including in strict profile (#300) 2025-05-09 08:44:40 -07:00
Brandon Keiji
74cc554ac4 fix(sandbox): set --inspect-brk in production sandbox when env DEBUG is truthy (#295) 2025-05-08 21:12:19 -07:00
Olcan
4aab3d57c3 allow SEATBELT_PROFILE=none to disable seatbelt on macos (#296) 2025-05-08 15:52:04 -07:00
Olcan
46a93c0bd1 refined sandbox/seatbelt log message, pass NODE_OPTIONS along to sandboxed node (#292) 2025-05-08 14:50:35 -07:00
Olcan
a2fadaca76 minor comment fix (#290) 2025-05-08 11:31:12 -07:00
Olcan
e9dedf5ad2 adjust seatbelt to allow write into specific dirs under user home (#289) 2025-05-08 11:28:45 -07:00
Olcan
9577f8b1e4 rename SANDBOX_EXEC_PROFILE as SEATBELT_PROFILE, and fix another accidental rephrasing (#285) 2025-05-07 21:31:30 -07:00
Olcan
12f082673e use seatbelt on macos, with two profiles: minimal (default) which only restricts writes, and strict, which is deny-by-default and only allows specific operations (#283) 2025-05-07 20:03:29 -07:00
Brandon Keiji
6e8967cdca fix(sandbox): consolidate dev and prod sandbox (#273) 2025-05-07 07:23:13 -07:00
Olcan
ca3105b70d make sandbox venv support more robust, allowing arbitrary venv path, and ignoring venv outside workdir (instead of erroring out) (#254) 2025-05-03 09:12:44 -07:00
Olcan
11163519a6 enable recreating a python virtual env (.venv folder) inside sandbox (#253) 2025-05-03 00:39:31 -07:00
Olcan
aeac4f0e20 custom sandboxing via sandbox.Dockerfile and sandbox.bashrc in project settings (#249) 2025-05-02 14:07:40 -07:00
Olcan
5f78298a5d pass PATH and PYTHONPATH into sandbox, let sandbox scripts recognize user settings for sandbox (#247) 2025-05-02 12:04:22 -07:00
Olcan
0200fdc27c sandbox setting and argument (#243) 2025-05-02 08:15:46 -07:00
Olcan
c4d68dccf2 mount user settings in sandbox (#239) 2025-05-01 12:08:24 -07:00
Olcan
cbbcabe35f remove start_sandbox.sh script (#238) 2025-05-01 09:16:33 -07:00
Brandon Keiji
a712210281 refactor: make parseImageName more readable (#228) 2025-04-30 10:16:29 -07:00
Brandon Keiji
c3ea8888d4 refactor(sandbox): make cli path agnostic of docker container build rules (#226) 2025-04-30 00:39:00 -07:00
Brandon Keiji
cc49c17b92 refactor: move sandbox js code to its own module (#225) 2025-04-29 17:38:25 -07:00
Allen Hutchison
fcea453c02 Piped input (#104)
* New method for handling stdin. Bypass Ink, and output to stdout. Makes the CLI work like a typical Unix application when called with piped input.

* Fixing a few post-merge errors.

* Format code.

* Clean up lint and format errors.
2025-04-21 17:41:44 -07:00
Taylor Mullen
c282e8b67e Fix Gemini Code's (GC) smarts.
- The tl;dr; is that GC couldn't see what the user was saying when tool call events happened in response. The rason why this was happening was because we were instantly invoking tools that the model told us to invoke and then instantly re-requesting. This resulted in the bug because the genai APIs can't update the chat history before a full response has been completed (doesn't know how to update if it's incomplete).
- To address the above issue I had to do quite the large refactor. The gist is that now turns truly drive everything on the server (vs. a server client split). This ensured that when we got tool invocations we could control when/how re-requesting would happen and then also ensure that history was updated. This change also meant that the server would act as an event publisher to enable the client to react to events rather than try and weave in complex logic between the events.
- A BIG change that this changeset incudes is the removal of all of the CLI tools in favor of the server tools.
- Removed some dead code as part of this
- **NOTE: Confirmations are still broken (they were broken prior to this); however, I've set them up to be able to work in the future, I'll dot hat in a follow up to be less breaking to others.**

Fixes https://b.corp.google.com/issues/412320087
2025-04-21 11:07:09 -04:00
Evan Senter
236949431b Starting to modularize into separate cli / server packages. (#55)
* Starting to move a lot of code into packages/server

* More of the massive refactor, builds and runs, some issues though.

* Fixing outstanding issue with double messages.

* Fixing a minor UI issue.

* Fixing the build post-merge.

* Running formatting.

* Addressing comments.
2025-04-19 19:45:42 +01:00
Tyler
c26606d4a3 Add apache2 SPDX headers to all source files (#48) 2025-04-18 17:44:24 -07:00
Taylor Mullen
a054fdde31 Run npm run format
- This has the entirety of the changes.

Part of https://b.corp.google.com/issues/411720532
2025-04-18 18:10:57 -04:00