Agent → stdout: one JSON object per line, flushed.
()
| 138 | out = sys.stdout |
| 139 | |
| 140 | async def outbound() -> None: |
| 141 | """Agent → stdout: one JSON object per line, flushed.""" |
| 142 | async for msg in agent.messages_from_agent(): |
| 143 | try: |
| 144 | out.write(json.dumps(msg) + "\n") |
| 145 | out.flush() |
| 146 | except (BrokenPipeError, OSError): |
| 147 | return |
| 148 | |
| 149 | # Inbound: a daemon thread reads stdin lines and dispatches them onto the |
| 150 | # loop (mirrors the existing threaded pattern). stdin EOF resolves `closed`. |
no test coverage detected