Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a1f05fa
Update Guardian handoff snapshot for separate agent messages (#49065)
cassirer-openai Sep 28, 2026
5a5a4aa
Keep configuration values out of Windows sandbox policy events (#49067)
zm-oai Sep 28, 2026
33a0f76
Reclaim unused SQLite log database pages in the background (#49069)
dkovalenko-oai Sep 28, 2026
15c08be
Surface realtime voice catalog failures in the TUI (#49073)
etraut-openai Sep 28, 2026
22d1d93
Propagate Cargo package versions to Bazel Rust targets (#49074)
tamird Sep 28, 2026
3749d1e
Preserve pending environments when spawning subagents (#49075)
sayan-oai Sep 28, 2026
011f803
Avoid collecting unused Git metadata in skill analytics (#49076)
tamird Sep 28, 2026
fe50d01
Update and centralize TUI subscription labels (#49079)
etraut-openai Sep 28, 2026
46d2585
Skip remote Git discovery for Guardian diff paths (#49082)
jif-oai Sep 28, 2026
88e9a83
Track app-server running turns incrementally (#49084)
tamird Sep 28, 2026
222e24b
Render follow-up directive labels in the TUI and copied responses (#4…
etraut-openai Sep 28, 2026
19892ae
Simplify startup promotions to platform-specific desktop app tips (#4…
etraut-openai Sep 28, 2026
2ce6484
Update `h2` from 0.4.16 to 0.4.19 in Cargo and Bazel lockfiles (#49096)
cassirer-openai Sep 28, 2026
9563713
Notify lifecycle extensions of compaction usage limits (#49097)
xli-oai Sep 28, 2026
f543051
Resolve Windows sandbox PowerShell fallbacks on the exec server (#49098)
zm-oai Sep 28, 2026
1260716
Cache parsed plugin manifests across plugin workflows (#49099)
dkovalenko-oai Sep 28, 2026
bfdb157
Reuse the HTTP connection pool for remote plugin requests (#49100)
dkovalenko-oai Sep 28, 2026
c2d2f42
Preserve SQLite vacuum modes and surface pool initialization errors (…
bc-openai Sep 28, 2026
7e049b3
Balance Windows Bazel test shards using duration estimates (#49103)
jgershen-oai Sep 28, 2026
136391a
Resume unsent TUI input after reconnecting (#49105)
etraut-openai Sep 28, 2026
8f65177
Add history pagination to the agent command center (#49106)
bc-openai Sep 28, 2026
0196495
Add X11 primary selection and middle-click paste support (#49112)
fcoury-oai Sep 29, 2026
69043f0
Point remote compaction tests at the mock ChatGPT server (#49114)
OLI-OAI Sep 29, 2026
2e6cc4e
Attribute analytics requests to each thread's product SKU (#49117)
papayo-oai Sep 29, 2026
6c49240
Correct provider authentication storage documentation (#49118)
celia-oai Sep 29, 2026
8bd5a13
Add recovery guidance to content-filter retries (#49119)
won-openai Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/scripts/select_windows_bazel_targets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/env python3

"""Assign Windows Bazel test targets using checked-in duration estimates."""

import argparse
import sys
from pathlib import Path


DEFAULT_DURATION_SECONDS = 1
DURATIONS_PATH = Path(__file__).with_name("windows_bazel_test_durations.tsv")


def read_durations(path: Path) -> dict[str, int]:
durations = {}
for line_number, line in enumerate(
path.read_text(encoding="utf-8").splitlines(), 1
):
if not line.strip() or line.lstrip().startswith("#"):
continue
fields = line.split("\t")
if len(fields) != 2 or not fields[0] or not fields[1].isdecimal():
raise ValueError(
f"{path}:{line_number}: expected target<TAB>positive integer"
)
target, duration_text = fields
duration = int(duration_text)
if duration < 1:
raise ValueError(f"{path}:{line_number}: duration must be positive")
if target in durations:
raise ValueError(f"{path}:{line_number}: duplicate target {target}")
durations[target] = duration
return durations


def assign_targets(
targets: list[str], durations: dict[str, int], shard_count: int
) -> tuple[list[list[str]], list[int]]:
if shard_count < 1:
raise ValueError("shard count must be positive")
if not targets:
raise ValueError("no Bazel test targets were provided")
if any(not target.strip() for target in targets):
raise ValueError("Bazel test target labels must not be empty")
if len(targets) != len(set(targets)):
raise ValueError("duplicate Bazel test target labels were provided")

assignments: list[list[str]] = [[] for _ in range(shard_count)]
loads = [0] * shard_count
# Place the longest targets first, breaking ties by label and shard number.
for target in sorted(
targets,
key=lambda target: (-durations.get(target, DEFAULT_DURATION_SECONDS), target),
):
shard = min(range(shard_count), key=lambda shard: (loads[shard], shard))
assignments[shard].append(target)
loads[shard] += durations.get(target, DEFAULT_DURATION_SECONDS)
for assignment in assignments:
assignment.sort()
return assignments, loads


def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--shard", required=True, type=int)
parser.add_argument("--shard-count", required=True, type=int)
parser.add_argument(
"--durations",
type=Path,
default=DURATIONS_PATH,
help="use this timing file instead of the checked-in default",
)
args = parser.parse_args()
if not 1 <= args.shard <= args.shard_count:
parser.error("shard must be between 1 and shard count")

try:
durations = read_durations(args.durations)
targets = sys.stdin.read().splitlines()
assignments, loads = assign_targets(targets, durations, args.shard_count)
except (OSError, ValueError) as error:
parser.error(str(error))

selected_targets = assignments[args.shard - 1]
if not selected_targets:
parser.error(
f"no Bazel test targets selected for shard {args.shard}/{args.shard_count}"
)

target_set = set(targets)
print(
f"Windows Bazel shards: targets={[len(assignment) for assignment in assignments]}, "
f"estimated test-seconds={loads}, default weights={len(target_set - durations.keys())}, "
f"unused weights={len(durations.keys() - target_set)}. "
f"Selected shard {args.shard}/{args.shard_count}.",
file=sys.stderr,
)
# Keep LF delimiters when native Windows Python feeds Git Bash mapfile.
sys.stdout.buffer.write(("\n".join(selected_targets) + "\n").encode("utf-8"))


if __name__ == "__main__":
main()
147 changes: 147 additions & 0 deletions .github/scripts/test_select_windows_bazel_targets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path

from select_windows_bazel_targets import DURATIONS_PATH
from select_windows_bazel_targets import assign_targets
from select_windows_bazel_targets import read_durations


class SelectWindowsBazelTargetsTest(unittest.TestCase):
def test_balances_targets_with_complete_deterministic_coverage(self) -> None:
durations = {
f"//test:{name}": duration
for name, duration in zip("abcdefgh", range(8, 0, -1))
}
targets = list(durations)

assignments, loads = assign_targets(targets, durations, 4)

self.assertEqual(loads, [9, 9, 9, 9])
self.assertEqual(
sorted(target for shard in assignments for target in shard), sorted(targets)
)
self.assertEqual(
assign_targets(list(reversed(targets)), durations, 4), (assignments, loads)
)
self.assertTrue(all(shard == sorted(shard) for shard in assignments))

def test_missing_weights_use_one_and_unused_weights_do_not_create_targets(
self,
) -> None:
targets = ["//test:c", "//test:a", "//test:b"]

assignments, loads = assign_targets(targets, {"//test:stale": 100}, 2)

self.assertEqual(assignments, [["//test:a", "//test:c"], ["//test:b"]])
self.assertEqual(loads, [2, 1])

def test_rejects_empty_or_duplicate_target_input(self) -> None:
for targets in ([], [""], ["//test:a", "//test:a"]):
with self.subTest(targets=targets), self.assertRaises(ValueError):
assign_targets(targets, {}, 4)

def test_reads_duration_file_and_rejects_invalid_weights(self) -> None:
with tempfile.TemporaryDirectory() as temp_dir:
path = Path(temp_dir) / "durations.tsv"
path.write_text(
"# comment\n\n//test:a\t12\n//test:b\t1\n", encoding="utf-8"
)
self.assertEqual(read_durations(path), {"//test:a": 12, "//test:b": 1})

for contents in (
"//test:a 12\n",
"//test:a\t0\n",
"//test:a\t-1\n",
"//test:a\t1.5\n",
"//test:a\t1\n//test:a\t2\n",
):
with self.subTest(contents=contents), self.assertRaises(ValueError):
path.write_text(contents, encoding="utf-8")
read_durations(path)

def test_cli_uses_checked_in_weights_and_writes_only_lf_delimited_targets(
self,
) -> None:
durations = read_durations(DURATIONS_PATH)
known = sorted(durations, key=lambda target: (-durations[target], target))[:4]
self.assertEqual(len(known), 4)
targets = [*known, "//test:new-target"]
expected, _ = assign_targets(targets, durations, 4)
script = DURATIONS_PATH.with_name("select_windows_bazel_targets.py")

for shard, assignment in enumerate(expected, 1):
command = [
sys.executable,
str(script),
"--shard",
str(shard),
"--shard-count",
"4",
]
for ordered_targets in (targets, list(reversed(targets))):
with self.subTest(shard=shard, ordered_targets=ordered_targets):
result = subprocess.run(
command,
input=("\r\n".join(ordered_targets) + "\r\n").encode(),
capture_output=True,
check=True,
)
self.assertEqual(
result.stdout, ("\n".join(assignment) + "\n").encode()
)
self.assertIn(b"default weights=1", result.stderr)

def test_cli_uses_only_the_requested_duration_file(self) -> None:
script = DURATIONS_PATH.with_name("select_windows_bazel_targets.py").resolve()
with tempfile.TemporaryDirectory() as temp_dir:
path = Path(temp_dir) / "durations.tsv"
path.write_text("//test:a\t1\n//test:b\t9\n", encoding="utf-8")
command = [sys.executable, str(script), "--shard-count", "2"]
for shard, expected in ((1, b"//test:b\n"), (2, b"//test:a\n//test:c\n")):
with self.subTest(shard=shard):
result = subprocess.run(
[*command, "--shard", str(shard), "--durations", path.name],
input=b"//test:a\n//test:b\n//test:c\n",
cwd=temp_dir,
capture_output=True,
check=True,
)
self.assertEqual(result.stdout, expected)
self.assertIn(b"estimated test-seconds=[9, 2]", result.stderr)
self.assertIn(b"unused weights=0", result.stderr)

result = subprocess.run(
[*command, "--shard", "1", "--durations", "missing.tsv"],
input=b"//test:a\n",
cwd=temp_dir,
capture_output=True,
check=False,
)
self.assertNotEqual(result.returncode, 0)
self.assertEqual(result.stdout, b"")
self.assertIn(b"missing.tsv", result.stderr)

def test_cli_rejects_bad_or_empty_selection_without_partial_output(self) -> None:
script = DURATIONS_PATH.with_name("select_windows_bazel_targets.py")
for targets, error in (
(b"", b"no Bazel test targets were provided"),
(b"//test:a\n//test:a\n", b"duplicate Bazel test target labels"),
(b"//test:a\n", b"no Bazel test targets selected for shard 2/2"),
):
with self.subTest(targets=targets):
result = subprocess.run(
[sys.executable, str(script), "--shard", "2", "--shard-count", "2"],
input=targets,
capture_output=True,
check=False,
)
self.assertNotEqual(result.returncode, 0)
self.assertEqual(result.stdout, b"")
self.assertIn(error, result.stderr)


if __name__ == "__main__":
unittest.main()
Loading
Loading