code-puppy 1.0.1__tar.gz → 1.0.2__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 (40) hide show
  1. {code_puppy-1.0.1 → code_puppy-1.0.2}/PKG-INFO +1 -1
  2. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/main.py +32 -1
  3. {code_puppy-1.0.1 → code_puppy-1.0.2}/pyproject.toml +1 -1
  4. {code_puppy-1.0.1 → code_puppy-1.0.2}/.gitignore +0 -0
  5. {code_puppy-1.0.1 → code_puppy-1.0.2}/LICENSE +0 -0
  6. {code_puppy-1.0.1 → code_puppy-1.0.2}/README.md +0 -0
  7. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/__init__.py +0 -0
  8. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/__main__.py +0 -0
  9. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/_art.py +0 -0
  10. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/api_keys.py +0 -0
  11. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/branding.py +0 -0
  12. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/builtin_plugins.py +0 -0
  13. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/callbacks.py +0 -0
  14. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/colors.py +0 -0
  15. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/compat/__init__.py +0 -0
  16. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/compat/bridge.py +0 -0
  17. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/compat/tools.py +0 -0
  18. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/config.py +0 -0
  19. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/distribution.py +0 -0
  20. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/first_run.py +0 -0
  21. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/former_name.py +0 -0
  22. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/i18n/__init__.py +0 -0
  23. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/identity.py +0 -0
  24. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/legacy_sessions.py +0 -0
  25. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/legacy_store.py +0 -0
  26. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/messaging/__init__.py +0 -0
  27. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/messaging/bus.py +0 -0
  28. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/migrate/__init__.py +0 -0
  29. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/migrate/runner.py +0 -0
  30. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/migrate/sources.py +0 -0
  31. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/migrate/translate.py +0 -0
  32. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/personality.py +0 -0
  33. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/plugins/__init__.py +0 -0
  34. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/plugins/source_only.py +0 -0
  35. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/plugins/trust.py +0 -0
  36. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/splash/__init__.py +0 -0
  37. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/splash/__main__.py +0 -0
  38. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/splash/canvas.py +0 -0
  39. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/splash/scenes.py +0 -0
  40. {code_puppy-1.0.1 → code_puppy-1.0.2}/code_puppy/update.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: code-puppy
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Code generation agent
5
5
  Project-URL: repository, https://github.com/mpfaffenberger/code_puppy
6
6
  Project-URL: HomePage, https://github.com/mpfaffenberger/code_puppy
@@ -7,15 +7,20 @@ it animates. The order below is load-bearing; see ``distribution``.
7
7
  from __future__ import annotations
8
8
 
9
9
  import json
10
+ import logging
10
11
  import os
11
12
  import sqlite3
12
13
  import sys
13
14
  import warnings
15
+ from collections.abc import Iterator
16
+ from contextlib import contextmanager
14
17
  from pathlib import Path
15
18
 
16
19
  from code_puppy import identity
17
20
 
18
21
  NO_SPLASH_VARIABLES = ("CODE_PUPPY_NO_SPLASH", "CLAI_NO_SPLASH")
22
+ WSAECONNRESET = 10054
23
+ """Windows' "connection forcibly closed by the remote host"."""
19
24
 
20
25
 
21
26
  def _load_dotenv() -> None:
@@ -105,6 +110,32 @@ def _own_command(argv: list[str]) -> int | None:
105
110
  return migrate.main(argv[2:])
106
111
 
107
112
 
113
+ def _not_a_peer_reset(record: logging.LogRecord) -> bool:
114
+ exc = record.exc_info[1] if record.exc_info else None
115
+ return not (
116
+ isinstance(exc, ConnectionResetError)
117
+ and getattr(exc, "winerror", None) == WSAECONNRESET
118
+ )
119
+
120
+
121
+ @contextmanager
122
+ def quiet_peer_resets() -> Iterator[None]:
123
+ """Keep Windows' WinError 10054 socket-teardown traceback off the live display.
124
+
125
+ When a server drops an idle keep-alive connection, asyncio's Proactor loop
126
+ raises it while closing the socket and logs it on the ``asyncio`` logger.
127
+ The connection was already gone; nothing is lost. Only this record is
128
+ dropped: every other asyncio error still reaches stderr. Remove once
129
+ pydantic/pydantic-ai#14639 ships in the pinned pax.
130
+ """
131
+ logger = logging.getLogger("asyncio")
132
+ logger.addFilter(_not_a_peer_reset)
133
+ try:
134
+ yield
135
+ finally:
136
+ logger.removeFilter(_not_a_peer_reset)
137
+
138
+
108
139
  def main_entry() -> None:
109
140
  """Start Code Puppy: pydantic-ai-pax with Code Puppy's identity installed."""
110
141
  _load_dotenv()
@@ -131,7 +162,7 @@ def main_entry() -> None:
131
162
  from pydantic_ai_pax.__main__ import quiet_telemetry_logs
132
163
  from pydantic_ai_pax.cli.cli import run
133
164
 
134
- with warnings.catch_warnings(), quiet_telemetry_logs():
165
+ with warnings.catch_warnings(), quiet_telemetry_logs(), quiet_peer_resets():
135
166
  if not sys.warnoptions:
136
167
  # Library warnings are advice for whoever wired the agent, not
137
168
  # the person at the prompt, and stderr output tears through the
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "code-puppy"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  description = "Code generation agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11,<3.15"
File without changes
File without changes
File without changes