@@ -115,8 +115,16 @@ jobs:
115115 echo ""
116116 echo "=== Installed package assert_done (from imported module) ==="
117117 python << 'PYEOF'
118+ import sys
118119 import inspect
119120 import os
121+
122+ # Set UTF-8 encoding for Windows compatibility
123+ if sys.platform == 'win32':
124+ import io
125+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
126+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
127+
120128 from sentience.agent_runtime import AgentRuntime
121129
122130 # Verify it's using local source
@@ -143,7 +151,7 @@ jobs:
143151 if 'self.assertTrue(' in line:
144152 print(f' Line {i}: {line.strip()}')
145153 print('\nThe source file in the repo should be checked and fixed.')
146- exit(1)
154+ sys. exit(1)
147155 elif 'self.assert_(' in source:
148156 print('OK: assert_done uses self.assert_( correctly')
149157 else:
@@ -265,9 +273,17 @@ jobs:
265273 run : |
266274 # Final verification before tests - ensure we're using the right code
267275 python << 'PYEOF'
268- import sentience.agent_runtime
276+ import sys
269277 import inspect
270278
279+ # Set UTF-8 encoding for Windows compatibility
280+ if sys.platform == 'win32':
281+ import io
282+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
283+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
284+
285+ import sentience.agent_runtime
286+
271287 print("=== Final Pre-Test Verification ===")
272288 src = inspect.getsource(sentience.agent_runtime.AgentRuntime.assert_done)
273289
@@ -276,7 +292,7 @@ jobs:
276292 print("\n=== Analysis ===")
277293
278294 if 'self.assertTrue(' in src:
279- print('✗ ERROR: Found self.assertTrue( in installed package!')
295+ print('ERROR: Found self.assertTrue( in installed package!')
280296 print('The source code on this branch still has the bug.')
281297 print('\nProblematic lines:')
282298 for i, line in enumerate(src.split('\n'), 1):
@@ -285,13 +301,13 @@ jobs:
285301 print('\nThis branch needs to be updated with the fix.')
286302 print('The fix commit is: c7a43a9 or equivalent')
287303 print('Fix: Replace self.assertTrue( with self.assert_( in the code above')
288- exit(1)
304+ sys. exit(1)
289305 elif 'self.assert_(' in src:
290- print('✓ OK: assert_done uses self.assert_( correctly')
306+ print('OK: assert_done uses self.assert_( correctly')
291307 print('Tests should pass.')
292308 else:
293- print('? WARNING: Could not find assert_ method call in assert_done')
294- exit(1)
309+ print('WARNING: Could not find assert_ method call in assert_done')
310+ sys. exit(1)
295311 PYEOF
296312 pytest tests/ -v
297313 env :
0 commit comments