Skip to content

(janitor/comments): remove noise comments from services/cloud-agent-next - #6470

Closed
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
kilo/round-nest-f0a
Closed

kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
kilo/round-nest-f0a

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Package or topic area cleaned

services/cloud-agent-next (Cloudflare Worker powering Kilocode Cloud Agents: src/, wrapper/src/, test/, wrapper/src tests). Chosen as the single highest-density coherent area: ~431 section-banner separator lines plus concentrated narration/commented-setup noise, all within one service.

Files touched

61 files (all under services/cloud-agent-next/): 34 in src/, 14 in wrapper/src/, 13 in test/.

Number of comment lines removed

  • 760 comment lines removed, plus 220 directly-attached blank lines (banner group spacing). 980 deletions total, 0 lines added.

Categories of noise removed

  • Section banner separators (// ---- Title ---- triplets): 215 groups, e.g. // Types, // Helpers, // Constants, // Test: unexpected close triggers reconnection
  • Narration comments restating the next line: // Create WebSocket pair, // Check for uncommitted changes, // Fetch metadata with retry, // Stop HTTP server, // Clear state references
  • Test setup/execution/expectation narration: // Create caller with mocked context, // Verify secrets are NOT returned, // Trigger reconnection, // Filter by executionId
  • Branch-case labels duplicating visible if conditions: // Case 1: Exists in both places... in src/workspace.ts
  • Duplicate description of git branch states, mock wiring, and alarm-trigger one-liners whose content the following call already expresses

Important comments intentionally retained

  • Security rationale (e.g. src/router/schemas.ts block on why callback headers are never returned by getSession)
  • Suppression directives: all eslint-disable, @ts-expect-error comments left unchanged
  • External/protocol behavior notes (JSON-RPC error codes, WebSocket hibernation constraints, cgroup /proc format parsing)
  • Business-rule comments (lease safety notes, wrapper identity fencing, delivery retry budgets, scenario timeout keys)
  • Live TODO markers and the // Note: Balance validation is now handled in the worker entry point navigation note
  • Scenario-ID traceability in test/e2e/SESSION-CONTINUITY.md is preserved via scenario slugs in function names; the removed banner titles carried only slugs
  • Restored/kept two comments that explain why rather than narrate: the CLI-entry note in test/e2e/fake-llm-server.ts and the utils-mock rationale in test/unit/wrapper/auto-commit.test.ts

Follow-up refactor candidates

None identified. No comment deletion removed understanding that code could not express; src/server.ts:100 and src/server.ts:646 TODOs (naming/refactor suggestions) were left in place.

Validation performed

  • pnpm run lint (oxlint, 558 files): 0 warnings, 0 errors
  • pnpm run format:check (oxfmt): no differences
  • pnpm run typecheck (tsgo + wrapper): pass
  • pnpm run test (unit, Vitest Node): 225 files, 6785 passed, 3 skipped
  • pnpm -C wrapper run test: 1573 passed, 0 fail
  • Touched integration tests (vitest.workers.config.ts): 6 files, 68 passed
  • Diff audit: every removed line is a comment or directly-attached blank; no directives, no non-comment content, no introduced double blank lines

Delete section banner separators, narration comments that restate the
following code, and test setup/execution narration across the service.
No application, type, test, or directive changes: 61 files, 760 comment
lines and 220 directly-attached blank lines removed, 0 lines added.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 21, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 21, 2026 08:18
@kilo-code-bot

kilo-code-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Verified that this comment-only janitorial PR removes exactly 981 lines (61 files, 0 additions) and that every removed line is a // comment or an attached blank line, with no code, directive, or block-comment delimiter moved.

Verification Performed

  • Diff audit: gh pr diff 6470 --patch contains 61 +++ headers and zero added content lines, so no code was introduced.
  • Removed-line classification: every deleted line matches a // comment or blank-line shape; no /*, */, * continuation, or non-comment line was deleted anywhere in the patch.
  • Directive preservation: no removed line contains eslint-disable, oxlint, @ts-expect-error/@ts-ignore/@ts-nocheck, prettier-ignore, istanbul/c8 ignore/v8 ignore, @vitest-environment, /// <reference, #__PURE__, @license, or any @-tagged JSDoc, so no tooling or suppression semantics changed.
  • No .md files are touched, so the markdown image-format rule is not applicable.
  • No runtime/executable code changed, so this PR cannot introduce a memory leak or behavioral regression; the only possible impact of removing comment lines is documentation density, and the PR intentionally retains security rationale, business-rule notes, and live TODOs.
  • Head confirmed at b28d00e4796edb43cae3e7c079b87d10f8d480ed immediately before publication; no pre-existing review comments or reviews to reconcile.
Files Reviewed (61 files)
  • services/cloud-agent-next/src/balance-validation.test.ts
  • services/cloud-agent-next/src/core/execution.ts
  • services/cloud-agent-next/src/core/lease.ts
  • services/cloud-agent-next/src/execution/types.ts
  • services/cloud-agent-next/src/kilo/devcontainer.test.ts
  • services/cloud-agent-next/src/kilo/devcontainer.ts
  • services/cloud-agent-next/src/kilo/types.ts
  • services/cloud-agent-next/src/kilo/wrapper-client.test.ts
  • services/cloud-agent-next/src/kilo/wrapper-client.ts
  • services/cloud-agent-next/src/kilo/wrapper-manager.ts
  • services/cloud-agent-next/src/lib/result.ts
  • services/cloud-agent-next/src/persistence/CloudAgentSession.ts
  • services/cloud-agent-next/src/persistence/schemas.ts
  • services/cloud-agent-next/src/router.test.ts
  • services/cloud-agent-next/src/router/auth.ts
  • services/cloud-agent-next/src/router/handlers/session-management.ts
  • services/cloud-agent-next/src/sandbox-timeout-logging.ts
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session/queries/events.ts
  • services/cloud-agent-next/src/session/queries/executions.ts
  • services/cloud-agent-next/src/session/queries/leases.ts
  • services/cloud-agent-next/src/session/session-registration.ts
  • services/cloud-agent-next/src/session/types.ts
  • services/cloud-agent-next/src/shared/slash-commands.test.ts
  • services/cloud-agent-next/src/types/ids.ts
  • services/cloud-agent-next/src/websocket/filters.ts
  • services/cloud-agent-next/src/websocket/index.ts
  • services/cloud-agent-next/src/websocket/ingest.test.ts
  • services/cloud-agent-next/src/websocket/ingest.ts
  • services/cloud-agent-next/src/websocket/stream.test.ts
  • services/cloud-agent-next/src/websocket/stream.ts
  • services/cloud-agent-next/src/websocket/types.ts
  • services/cloud-agent-next/src/workspace.test.ts
  • services/cloud-agent-next/src/workspace.ts
  • services/cloud-agent-next/test/e2e/auth.ts
  • services/cloud-agent-next/test/e2e/client.ts
  • services/cloud-agent-next/test/e2e/fake-llm-server.ts
  • services/cloud-agent-next/test/e2e/lifecycle-continuity.ts
  • services/cloud-agent-next/test/e2e/lifecycle.ts
  • services/cloud-agent-next/test/integration/sandbox-session-reports.test.ts
  • services/cloud-agent-next/test/integration/session/events.test.ts
  • services/cloud-agent-next/test/integration/session/execute-directly-failure.test.ts
  • services/cloud-agent-next/test/integration/session/execution-id-removal.test.ts
  • services/cloud-agent-next/test/integration/session/leases.test.ts
  • services/cloud-agent-next/test/integration/session/message-terminalization.test.ts
  • services/cloud-agent-next/test/unit/fake-llm-server.test.ts
  • services/cloud-agent-next/test/unit/wrapper/auto-commit.test.ts
  • services/cloud-agent-next/test/unit/wrapper/connection.test.ts
  • services/cloud-agent-next/test/unit/wrapper/reconnection.test.ts
  • services/cloud-agent-next/test/unit/wrapper/server.test.ts
  • services/cloud-agent-next/test/unit/wrapper/snapshot.test.ts
  • services/cloud-agent-next/test/unit/wrapper/worktree-credential-refresh.test.ts
  • services/cloud-agent-next/wrapper/src/auto-commit.ts
  • services/cloud-agent-next/wrapper/src/condense-on-complete.ts
  • services/cloud-agent-next/wrapper/src/connection.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.ts
  • services/cloud-agent-next/wrapper/src/main.ts
  • services/cloud-agent-next/wrapper/src/restore-session.test.ts
  • services/cloud-agent-next/wrapper/src/restore-session.ts
  • services/cloud-agent-next/wrapper/src/server.ts
  • services/cloud-agent-next/wrapper/src/tool-cgroup.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

auto-merge was automatically disabled September 22, 2026 15:41

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant