Repository navigation
fix(service): timestamp and rotate managed service logs - #7064
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37362bffb4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (process.argv[2] === "start" && process.env.OCX_SERVICE) startServiceLogging(join(getConfigDir(), "service.log")); | ||
| const updateRestartChild = admitUpdateRestartChild(process.argv.slice(2)); | ||
| initializeNodeLauncherContext(); |
There was a problem hiding this comment.
Detect start after consuming the launcher proof argument
When the managed Linux service uses the stable ocx launcher, bin/ocx.mjs:1168 prepends --ocx-internal-launch-proof=... before start, so process.argv[2] is the proof rather than the command at this point. Because initializeNodeLauncherContext() removes that argument only afterward, startServiceLogging is never activated for this normal systemd launch path: its output remains untimestamped and service.log grows without rotation. Consume or skip the internal proof before testing which command is running, and add coverage that enters through the package launcher.
Useful? React with 👍 / 👎.
# Conflicts: # scripts/test-layout/layout.json # tests/fixtures/test-layout-expected.json
|
Maintainer integration record (MAINTAINERS.md |
Summary
ocx startunderOCX_SERVICEnow prefixes console stdout/stderr lines with UTC ISO-8601 timestamps, including multiline diagnostics. Foreground output and other CLI commands retain their existing format.service.logat startup and once per minute; above 20 MiB, copy its newest 20 MiB into.1, retain the previous archive in.2, and truncate the active inode. Existing manager append handles keep working. Checks do not run on every write, filesystem failures never stop the service, and archive paths are registered for config cleanup.Verification
bun test tests/service/service-log.test.ts— 6 passed / 0 failed. The CLI timestamp regression was run before implementation and failed on the missing prefix; it passes after the fix. Tests cover all console sinks, multiline formatting, non-service output, startup/periodic rotation, two bounded generations, failure handling, and writes through a pre-opened append descriptor.OCX_TEST_NO_QUEUE=1 bun run test:changed --parallel=1— 6 passed / 0 failed across 1 selected file. The initialbun run test:changedwas stopped while queued behind another lane's shared test lock; the documented intentional-overlap option was used for this short single-worker run.bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/lab/core-lab-boundary.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/service/service-start-environment.test.ts tests/service/service-health-sentinel-launch.test.ts— 63 passed / 1 failed initially. The only failure was the new 2,000-line file-size threshold in the CLI entrypoint and layout map; both were brought below that threshold without increasing a cap.bun test tests/ci-workflows/file-size-ratchet.test.tsthen passed all 9 tests. The layout, Lab import/activation boundary, and adjacent service checks passed.bun run typecheck— passed.bun run structure:check— passed after moving the new contract to a dedicated doc within the existing line budgets and regeneratingstructure/INDEX.md.bun run privacy:scan— passed.cd docs-site && bun install --frozen-lockfile && bun run build— passed; 569 pages built and 79,406 internal links checked.bun run testomitted because multiple concurrent implementation worktrees contend for the shared runner. Broad Ubuntu suite coverage remains with PR CI; live launchd/systemd and Windows manager testing was not performed locally.Checklist
Summary by CodeRabbit