agentic-runner 3.30.2__tar.gz → 3.30.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/PKG-INFO +2 -2
  2. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/pyproject.toml +1 -1
  3. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/__init__.py +1 -1
  4. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/service.py +6 -2
  5. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workstation.py +26 -4
  6. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/.gitignore +0 -0
  7. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/LICENSE +0 -0
  8. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/README.md +0 -0
  9. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/activities.py +0 -0
  10. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/attempts.py +0 -0
  11. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/auth_mode.py +0 -0
  12. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/build.py +0 -0
  13. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/callback.py +0 -0
  14. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/child_watcher.py +0 -0
  15. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/cli.py +0 -0
  16. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/cli_floor.py +0 -0
  17. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/config.py +0 -0
  18. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/credentials.py +0 -0
  19. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/egress.py +0 -0
  20. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/harness_self_test.py +0 -0
  21. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/heartbeat_link.py +0 -0
  22. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/hooks.py +0 -0
  23. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/host_store.py +0 -0
  24. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/__init__.py +0 -0
  25. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/git/__init__.py +0 -0
  26. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/git/contracts.py +0 -0
  27. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/git/evidence.py +0 -0
  28. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/git/fake_workspace.py +0 -0
  29. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/git/workspace.py +0 -0
  30. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/github/__init__.py +0 -0
  31. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/github/auth.py +0 -0
  32. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/github/fake_client.py +0 -0
  33. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/github/gh_client.py +0 -0
  34. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/oauth/__init__.py +0 -0
  35. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/integrations/oauth/fake_provider.py +0 -0
  36. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/launch.py +0 -0
  37. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/lifecycle.py +0 -0
  38. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/llm_contracts.py +0 -0
  39. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/llm_proxy.py +0 -0
  40. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/mcp.py +0 -0
  41. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/message_store.py +0 -0
  42. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/oauth_connectors.py +0 -0
  43. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/organisation_name.py +0 -0
  44. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/pool_key.py +0 -0
  45. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/private_state.py +0 -0
  46. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/py.typed +0 -0
  47. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/recipient_key_secret.py +0 -0
  48. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/registration.py +0 -0
  49. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/runner_limit.py +0 -0
  50. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/runtime/__init__.py +0 -0
  51. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/runtime/verifier_command.py +0 -0
  52. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/sealed_box.py +0 -0
  53. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/sign_in.py +0 -0
  54. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/skill.py +0 -0
  55. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/skills/agentic-runner-setup/SKILL.md +0 -0
  56. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/testing/__init__.py +0 -0
  57. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/testing/__main__.py +0 -0
  58. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/testing/control_plane.py +0 -0
  59. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/testing/plugin.py +0 -0
  60. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/testing/test_conformance.py +0 -0
  61. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/testing/workflow.py +0 -0
  62. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/tiny_http.py +0 -0
  63. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/triage_activities.py +0 -0
  64. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/usage_windows.py +0 -0
  65. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/user_sources.py +0 -0
  66. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/__init__.py +0 -0
  67. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/_runtime_support.py +0 -0
  68. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/acp_runtime.py +0 -0
  69. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/agent_runtime.py +0 -0
  70. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/claude_runtime.py +0 -0
  71. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/claude_sign_in.py +0 -0
  72. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/codex_runtime.py +0 -0
  73. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/command_policy.py +0 -0
  74. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/contract_isolation.py +0 -0
  75. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/fastapi_client.py +0 -0
  76. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/harness_logins.py +0 -0
  77. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/harness_outcome.py +0 -0
  78. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/harness_usage.py +0 -0
  79. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/mcp_config.py +0 -0
  80. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/settings.py +0 -0
  81. {agentic_runner-3.30.2 → agentic_runner-3.30.4}/src/agentic_runner/workers/skills.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentic-runner
3
- Version: 3.30.2
3
+ Version: 3.30.4
4
4
  Summary: The Agentic OS Runner: an activity-only Temporal executor for workspaces, Agent Runtimes and verb seams
5
5
  License-Expression: AGPL-3.0-only
6
6
  License-File: LICENSE
7
7
  Requires-Python: >=3.12
8
- Requires-Dist: agentic-runner-contracts==3.30.2
8
+ Requires-Dist: agentic-runner-contracts==3.30.4
9
9
  Requires-Dist: cryptography<51,>=50
10
10
  Requires-Dist: httpx<1.0,>=0.27
11
11
  Requires-Dist: pydantic-settings<3.0,>=2.0
@@ -10,7 +10,7 @@ dependencies = [
10
10
  # Exactly this release's contracts: the two ship as one version, and an unpinned
11
11
  # requirement let `uv tool upgrade` keep an older contracts wheel the Runner cannot
12
12
  # import from (QTS-1473). `scripts/set-version.py` moves it with the version.
13
- "agentic-runner-contracts==3.30.2",
13
+ "agentic-runner-contracts==3.30.4",
14
14
  # Imported directly by `registration.py` (the Ed25519 identity that signs every
15
15
  # heartbeat); already present transitively through pyjwt[crypto], declared because
16
16
  # we import it.
@@ -7,6 +7,6 @@ stay on the platform; this package imports none of them, and a CI partition test
7
7
  (``tests/test_package_partition.py``) fails the build if that changes.
8
8
  """
9
9
 
10
- __version__ = "3.30.2"
10
+ __version__ = "3.30.4"
11
11
 
12
12
  __all__ = ["__version__"]
@@ -250,6 +250,10 @@ _VERIFIER_ACTIVITY_BUDGET_SECONDS = 20 * 60
250
250
  # returns before Kubernetes SIGKILLs the pod at terminationGracePeriodSeconds (the
251
251
  # chart's value and this must move together).
252
252
  _SHUTDOWN_HEADROOM_SECONDS = 60
253
+ # What `run` exits with once the control plane revokes this Runner: non-zero, as the
254
+ # conformance suite asks, and its own value so a workstation login agent can tell it from a
255
+ # crash its service manager should restart (QTS-2207).
256
+ REVOKED_EXIT_CODE = 3
253
257
 
254
258
  # What `agentic-runner status <name>` reads (PRD issue 47): the live pid, and a file the
255
259
  # process touches on every acknowledged heartbeat, whose mtime is the heartbeat age.
@@ -1692,7 +1696,7 @@ async def _serve_registered(
1692
1696
  raise
1693
1697
  except Exception as error: # noqa: BLE001 - keep trying until the control plane answers
1694
1698
  if _revoked(error):
1695
- return 1
1699
+ return REVOKED_EXIT_CODE
1696
1700
  _logger.warning("heartbeat failed before start: %s", error)
1697
1701
  await _before_stop(asyncio.sleep(interval), stop)
1698
1702
 
@@ -1767,7 +1771,7 @@ async def _serve_registered(
1767
1771
  await task
1768
1772
  await run_runner_lifecycle_hook(hooks, HookName.RUNNER_SHUTDOWN)
1769
1773
  await _report_stop(link, lifecycle)
1770
- return 1 if revoked.is_set() else 0
1774
+ return REVOKED_EXIT_CODE if revoked.is_set() else 0
1771
1775
 
1772
1776
 
1773
1777
  def _revoked(error: Exception) -> bool:
@@ -39,7 +39,7 @@ import sys
39
39
  import tempfile
40
40
  import time
41
41
  from collections.abc import Callable, Mapping, Sequence
42
- from dataclasses import dataclass
42
+ from dataclasses import dataclass, field
43
43
  from datetime import UTC, datetime
44
44
  from pathlib import Path
45
45
  from typing import Any, Final, Literal
@@ -114,7 +114,8 @@ ROOT_ENV: Final = "AGENTIC_RUNNER_WORKSTATION_ROOT"
114
114
  _LABEL_PREFIX: Final = "agentic-runner"
115
115
  # The drain waits out an in-flight Directive (issue 02), as the chart's
116
116
  # terminationGracePeriodSeconds does. Without it the service manager SIGKILLs the drain:
117
- # systemd after 90 s, launchd after 20 s (QTS-2166).
117
+ # systemd after 90 s, launchd after 20 s (QTS-2166), and launchd caps it at 60 s however
118
+ # high ExitTimeOut is set (QTS-2178), so on macOS `stop` and `restart` drain first.
118
119
  DRAIN_TIMEOUT_SECONDS: Final = 2100
119
120
 
120
121
  Run = Callable[..., subprocess.CompletedProcess[str]]
@@ -463,6 +464,9 @@ class ServiceDefinition:
463
464
  start: list[list[str]]
464
465
  stop: list[list[str]]
465
466
  restart: list[list[str]]
467
+ # Sends SIGTERM outside the service manager's own stop, which `stop` and `restart` then
468
+ # run only once the process has drained. Empty where that stop already waits it out.
469
+ drain: list[list[str]] = field(default_factory=list)
466
470
 
467
471
 
468
472
  def runner_command(name: str, root: Path) -> list[str]:
@@ -527,6 +531,10 @@ def _launch_agent(
527
531
  # One call, not bootout then bootstrap: launchd refuses a bootstrap of a label it
528
532
  # still holds, and it holds it until the old process has drained.
529
533
  restart=[["launchctl", "kickstart", "-k", f"{domain}/{name}"]],
534
+ # launchd SIGKILLs a stop of its own after at most 60 s, whatever ExitTimeOut says,
535
+ # but leaves alone a process that exits on a signal it only forwarded (CI, QTS-2178).
536
+ # A clean exit is not restarted: KeepAlive above.
537
+ drain=[["launchctl", "kill", "SIGTERM", f"{domain}/{name}"]],
530
538
  )
531
539
 
532
540
 
@@ -879,7 +887,9 @@ def restart(
879
887
  """
880
888
 
881
889
  previous = process_id(paths)
882
- _drive_service(paths, "restart", **driver)
890
+ _drive_service(paths, "restart", sleep=sleep, clock=clock, **driver)
891
+ # Taken after the call: the drain and then `kickstart -k`, or `systemctl restart`, return
892
+ # only once the old process has exited, so the drain spends none of it (QTS-2172).
883
893
  deadline = clock() + timeout
884
894
  while (pid := process_id(paths)) is None or pid == previous:
885
895
  if clock() >= deadline:
@@ -897,9 +907,17 @@ def _drive_service(
897
907
  platform: str = sys.platform,
898
908
  home: Path | None = None,
899
909
  run: Run = subprocess.run,
910
+ sleep: Callable[[float], None] = time.sleep,
911
+ clock: Callable[[], float] = time.monotonic,
900
912
  ) -> None:
901
913
  settings = WorkstationSettings.load(paths)
902
914
  definition = service_definition(paths, settings, platform=platform, home=home)
915
+ if verb != "start" and definition.drain and process_id(paths) is not None:
916
+ drive(definition.drain, run=run)
917
+ # Past the budget the service manager's stop below ends it, as systemd's would.
918
+ deadline = clock() + DRAIN_TIMEOUT_SECONDS
919
+ while process_id(paths) is not None and clock() < deadline:
920
+ sleep(1.0)
903
921
  drive(getattr(definition, verb), run=run)
904
922
 
905
923
 
@@ -925,4 +943,8 @@ def run_process(paths: RunnerPaths, *, login_agent: bool) -> int:
925
943
  # A workstation's hostname can name its person, so it is never reported (rev 3); the
926
944
  # name it was installed as is the person's choice, and the console lists it (QTS-1773).
927
945
  install = RunnerInstall(target=InstallTarget.WORKSTATION, name=paths.name)
928
- return asyncio.run(service.run(host_store=store, attestation=attestation, install=install))
946
+ code = asyncio.run(service.run(host_store=store, attestation=attestation, install=install))
947
+ # launchd, systemd and the logon task all restart a non-zero exit, and a revocation is
948
+ # final: restarted, the Runner dialled a control plane that refused it every ~10 s until
949
+ # someone stopped it by hand (QTS-2207). A clean exit keeps it down until the next login.
950
+ return 0 if code == service.REVOKED_EXIT_CODE else code
File without changes