Skip to content

fix: ensure first-time setup token reaches docker logs (#858) - #1180

Closed
DamageShadow wants to merge 2 commits into
Abilityai:devfrom
DamageShadow:feature/858-setup-token-logs
Closed

fix: ensure first-time setup token reaches docker logs (#858)#1180
DamageShadow wants to merge 2 commits into
Abilityai:devfrom
DamageShadow:feature/858-setup-token-logs

Conversation

@DamageShadow

Copy link
Copy Markdown

Summary

  • Add ENV PYTHONUNBUFFERED=1 to docker/backend/Dockerfile so lifespan print() output is not block-buffered on the Docker log pipe
  • Switch the first-time setup token block in main.py from print() to logger.warning() so the token flushes reliably and appears in structured logs / Vector

Fixes #858

Root cause

Without PYTHONUNBUFFERED=1, Python block-buffers stdout (~8KB) when connected to a Docker pipe (not a TTY). The setup token and ~30 other lifespan print() calls never reached docker compose logs backend, blocking fresh installs.

Test plan

  • Rebuilt backend image — docker exec trinity-backend env | grep PYTHONUNBUFFERED returns PYTHONUNBUFFERED=1
  • With setup_completed=false, restarted backend — docker compose logs backend | grep "Setup token:" returns the token as a JSON WARNING log
  • Lifespan status prints (e.g. Using dedicated scheduler service, Log archive service started) now visible in docker logs
  • CI passes

Made with Cursor

vybe and others added 2 commits June 12, 2026 16:24
…ion (#1139) (#1192) (#1193)

Replace Polyform Noncommercial 1.0.0 with the verbatim Apache License 2.0
(copyright 2025-2026 Ability AI) and update every license reference:

- LICENSE: verbatim Apache 2.0 text, appendix copyright line filled in
- NOTICE: added per Apache 2.0 convention
- README.md: badge -> Apache 2.0, tagline reframed from source-available
  to open source, License section rewritten (commercial-licensing
  paragraph reframed around enterprise modules)
- CONTRIBUTING.md: inbound-contribution terms now Apache 2.0 Section 5
- AGENTS.md, docs/onboarding/00-welcome.md: license mentions updated
- src/mcp-server/package.json: license MIT -> Apache-2.0
- src/cli/pyproject.toml + src/cli/README.md: license MIT -> Apache-2.0
  (same inconsistency class as the MCP server, found during audit)

grep -ri "polyform|noncommercial" returns no stale references.

Fixes #1139

Co-authored-by: Eugene Vyborov <eugene@beingluminous.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Python block-buffers print() when stdout is a Docker pipe without
PYTHONUNBUFFERED, so the setup token never appeared in logs. Add
PYTHONUNBUFFERED=1 to the backend Dockerfile and emit the token via
logger.warning so it flushes reliably and flows through Vector.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vybe

vybe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for fixing this! 🙏 One process note before it can be merged:

Per Trinity's SDLC (CLAUDE.md → SDLC, and .claude/DEVELOPMENT_WORKFLOW.md), contributor PRs land on dev first — work flows feature → dev → main, and main only ever receives release PRs cut from dev. This PR is currently based on main.

Could you retarget the base branch from main to dev? You can do it in place: click Edit next to the PR title and change the base dropdown to dev — no need to close/reopen. (You may need to rebase onto dev afterward.)

Heads-up: #1168 also addresses #858 (already approved, targeting dev) — worth a look to make sure these don't collide.

Thanks again!

@DamageShadow
DamageShadow changed the base branch from main to dev June 15, 2026 19:59
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@DamageShadow DamageShadow closed this by deleting the head repository Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: First-time setup token silently lost — print() block-buffered, breaks fresh installs

2 participants