Skip to content

refactor(runtime): remove routine agent and workspace traces - #174363

Closed
steipete wants to merge 0 commit into
mainfrom
deslop/z22-15-runtime-agent-traces-20261015
Closed

steipete wants to merge 0 commit into
mainfrom
deslop/z22-15-runtime-agent-traces-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Routine agent/runtime diagnostics accumulated argument-key inspection, private timing callbacks, duplicate start/success/status strings and unused stdout retention beside the real operation owners. These observers add work and noise without owning execution or recovery.

User Impact

Debug logs become quieter while real failure milestones, auth/refusal warnings, structured telemetry and operation results stay available. Plugin-command failures retain command/plugin identity but no longer copy arbitrary handler error content into ordinary logs; the user-facing generic failure reply is unchanged. Tools, provider/stream options, process readiness/draining, workspace transfer/finalization and media/plugin behavior are preserved. No CLI, config, persisted shape, protocol or SDK contract changes.

Why This Change Was Made

Remove the observer-only machinery and its exact private callers: tool-start metadata tracing, auth-stage callback/stopwatch, stream/harness/run/maintenance success logs, unused local-service stdout tail, workspace success timers/reporter and adjacent routine runtime-edge strings. Keep meaningful stderr/error evidence, structured/exported events, metrics, security checks and write settlement.

This is the agent/runtime-edge linked area split of one logging cleanup family, separated from diagnostics and infrastructure owners for narrow CI attribution. 355 net production lines removed (+26/-381,32 files); 113 test/support lines removed (+35/-148,5 files),plus one shrink-only baseline file(+1/-2),38 files total. Removed proof pins retired trace output; retained behavior assertions remain. One production-path plugin-command regression adds private error/stack sentinels and verifies content-free logs, the unchanged reply and settled execution admission.

Best-effort tradeoffs accepted

  • Routine per-step success/status consumers lose duplicate strings and auth-stage timing tables. Actual startup/execution stages, slow/failure diagnostics and structured telemetry remain; no guard or timeout policy is removed.
  • Workspace finalization no longer retains a debug-summary callback in a WeakMap or emits its duplicate success/failure summary. Shared reconciliation metrics, current-authority/final fences, publication/discard behavior and original failures remain unchanged.
  • Local-service stdout is drained without retaining an unused diagnostic copy. The failure formatter only reads bounded startup stderr, which remains, along with lifecycle/readiness/error records.
  • Ordinary plugin-command failure logs omit arbitrary handler error messages, which may echo private command content; registered command/plugin identity and a fixed failure category remain. The generic command-failed reply, authorization and invocation cleanup are unchanged. No guard is removed.

Provenance

Private auth-stage traces moved with #107900; successful auth/bootstrap observations with #152528/#161122. Harness selection logging came with #70760; commentary export with #156343; unused stdout retention's recent matching change is #158378. Workspace trace/metrics history includes #123564/#133447/#131254. The plugin-command executor filename and existing catch log were introduced by #121544 (d6f70a96cb1cd0515290bf51a0dc4615c737c27f); its selected-command dispatch and authority behavior remain intact. Their actual auth, export/privacy, service, cache and workspace behavior stays. These are log provenance references, not claims that feature fixes or security guards were speculative, nor verified original pre-extraction/human-incident attribution. No new accepted race, policy guard removal or in-flight feature deletion is involved.

Evidence

Current signed head27f15e58b8ffa0553ea6c02f034b4fe737250181 includes only a
mechanical baseline append to reviewed92cbe009a334dac323f9df77baaa10b55f4c46f8.
Existing serial isolated changed-source syntax scanner completed0 for32governed
production files and justified exactly tools.start5→2 and plugin-command1→0
allowance shrink/removal. No increased allowance or graph-config/dependency edit.
This narrow scan is not a typecheck/full ratchet/runtime pass. Reviewed source/test
hash remains9674839d6530515720565e50c13bc855baa40efebcf1d1ed57fcba4ed1e5b37c;
full patch including baselinec5664c08414960e10f81384af53abe33cfa7c107bd680d606efe99a026a3b688.
Normal scanner/staged guard/signing completed; no source re-review needed.

Passed: exact fresh-base source-drift comparison (zero drift across original36 paths), initial byte comparison with reviewed frozen composition, full diff/owner/caller simplification pass, targeted formatting check, git diff --check. After adding the plugin-command privacy closure, a fresh independent isolated Codex P0-P2 review captured the complete37-file candidate against pinned HEAD and finished terminal scoped-clean with no actionable findings. Source hash unchanged after final verification.

Local runtime tests and typechecking were not run in this sparse checkout without qualified application dependencies; no dependencies were installed or relinked. Exact-head hosted CI must cover the retained tool/auth/runtime and command failure contracts before landing, including type/lint/suppression/cycle gates. No local runtime pass or performance win is claimed. No retries, skips, timeout raises, new suppressions or weakened kept-behavior baselines.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 16, 2026 15:22
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling labels Oct 16, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:09:17.632178Z 0dc31f5 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 27f15e58b8ffa0553ea6c02f034b4fe737250181
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/effective-oauth.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/external-cli-sync.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/embedded-agent-runner/run/auth-plan.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes routine runtime logging, private timing observers, and unused stdout retention while excluding handler error content from plugin-command logs.

Example: The demo plugin command throws Error("private-plugin-command-payload").

  • Before: Verbose logs include the handler error message.
  • After: Verbose logs identify the command and plugin without the private payload; the command-failed reply remains unchanged.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The direction is justified, but supplied validation lacks a runtime demonstration and exact-head CI exposes an incomplete consumer cutover.
Proof confidence 🦪 silver shellfish (2/6) This maintainer-authored PR is outside the ordinary contributor proof gate and does not materially change authority; the inspected prepared images show an older usage dashboard rather than these logging paths.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Routine debug output adds noise and incidental processing, and plugin handler errors can echo private command content into ordinary logs.
Reason: The maintainer author explicitly approves the observability reduction, and the diff preserves execution, refusal, structured telemetry, and cleanup contracts.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-authored PR open: the cleanup is intentional and useful, but it leaves a confirmed failing regression test and obsolete troubleshooting instructions.

Priority: P3
Reviewed head: 27f15e58b8ffa0553ea6c02f034b4fe737250181

Before merge

  • Migrate the remaining reconciliation-log test consumer (P2) - Removing this reporter leaves node-worker-tunnel.test.ts:948–982 collecting a record that can no longer be emitted. Exact-head CI confirms the failure at line 951: expected two reports, received zero. Update that regression to observe memo reuse through the retained capture results or production metrics boundary, preserving its cross-turn hashing and late-write assertions without restoring the retired log.
  • Update troubleshooting instructions for the removed selection record (P3) - The harness-selection logger is removed, but this guide still tells operators to enable agents/harness debug logging and inspect the structured agent harness selected record. That troubleshooting procedure can no longer produce the promised selection reasons or candidate results. Remove or replace these instructions with an available diagnostic path.

Findings

  • [P2] Migrate the remaining reconciliation-log test consumer — src/gateway/worker-environments/workspace-finalize.ts:25-26
  • [P3] Update troubleshooting instructions for the removed selection record — docs/plugins/sdk-agent-harness/selection-policy.md:66-69

Provenance

  • Earlier tool-start trace introduction: original intent not found (unknown: Scoped git log -S encountered an unavailable historical blob; supplied blame establishes later extraction and refactoring but not the original reason.)

Tests

  • Missing end-to-end proof: No shipped-entry-point run of the changed logging behavior or base-fail/head-pass execution of the added privacy regression is supplied.
Agent review details

How this fits together

Agent, Gateway, plugin-command, and workspace owners execute operations and publish results; this change removes ancillary observations around those owners.

flowchart LR
  A[Agent or command request] --> B[Runtime owner]
  B --> C[Provider or plugin execution]
  B --> D[Workspace reconciliation]
  C --> E[Results and failure handling]
  D --> E
  B --> F[Retained structured diagnostics]
Loading

Technical review

Best possible solution:

Complete the test and documentation cutover while preserving workspace memo-reuse coverage and the accepted removal of routine logs.

Do we have a high-confidence way to reproduce the issue?

This is a refactor rather than a reported product bug; exact-head hosted CI independently demonstrates the stale workspace-test failure.

Is this the best way to solve the issue?

Removing private observers at their producers is appropriate, but dependent tests and operator instructions must move with the removal.

Full review comments:

  • [P2] Migrate the remaining reconciliation-log test consumer — src/gateway/worker-environments/workspace-finalize.ts:25-26
    Removing this reporter leaves node-worker-tunnel.test.ts:948–982 collecting a record that can no longer be emitted. Exact-head CI confirms the failure at line 951: expected two reports, received zero. Update that regression to observe memo reuse through the retained capture results or production metrics boundary, preserving its cross-turn hashing and late-write assertions without restoring the retired log.
    Confidence: 1
  • [P3] Update troubleshooting instructions for the removed selection record — docs/plugins/sdk-agent-harness/selection-policy.md:66-69
    The harness-selection logger is removed, but this guide still tells operators to enable agents/harness debug logging and inspect the structured agent harness selected record. That troubleshooting procedure can no longer produce the promised selection reasons or candidate results. Remove or replace these instructions with an available diagnostic path.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ed06da110adf.

Provenance checked

  • Stream parameter diagnostics changes intended behavior with a stated reason (e0e9935: Avoid diagnostic preparation when logging is disabled while retaining debug output when enabled.)
  • Harness-selection diagnostics changes intended behavior with a stated reason (137dbc7: Expose selection reasons and candidate support results for routing diagnosis.)
  • Commentary diagnostics keeps the original intent (904f9c0: Correlate completed commentary with harness traces while keeping content capture bounded and opt-in.)
  • Local-service output retention keeps the original intent (a46f780: Stop retaining runtime output after readiness; startup failure formatting uses stderr.)
  • Workspace reconciliation and transfer observations changes intended behavior with a stated reason (592bf90: Observe hashing, memo reuse, reconciliation outcomes, and transfer cost alongside the workspace owners.)
  • Plugin-command failure logging changes intended behavior with a stated reason (d6f70a9: The executor extraction established selected-plugin dispatch ownership and retained a handler-error log.)
  • Private auth-stage timing changes intended behavior with a stated reason (ca9bbf6: Timing callbacks moved with the orchestration split; this establishes their relocation rather than their original introduction.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/gateway/worker-environments/node-worker-tunnel.test.ts --maxWorkers=1
  • pnpm exec oxlint src/gateway/worker-environments/node-worker-tunnel.test.ts
  • pnpm exec oxfmt --check src/gateway/worker-environments/node-worker-tunnel.test.ts docs/plugins/sdk-agent-harness/selection-policy.md
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1730d1c adds src/gateway/worker-environments/workspace-finalize.ts:75 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1730d1cba7d3; files: src/gateway/worker-environments/workspace-finalize.ts)
  • Vincent Koc: Raw commit 904f9c0 adds src/agents/harness/commentary-diagnostics.ts:60 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 904f9c03a317; files: src/agents/harness/commentary-diagnostics.ts)

PR surface

Source -355, Tests -113, Other -1. Total -469 across 38 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 32 26 381 -355
Tests 5 35 148 -113
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 2 -1
Total 38 62 531 -469

Labels

Label changes:

  • add P3: This is an intentional observability cleanup with focused test and documentation repairs; no urgent user-facing runtime regression was established.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an intentional observability cleanup with focused test and documentation repairs; no urgent user-facing runtime regression was established.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 11:40 AM ET / 15:40 UTC.

@steipete steipete closed this Oct 16, 2026
@steipete
steipete force-pushed the deslop/z22-15-runtime-agent-traces-20261015 branch from 27f15e5 to 0dc31f5 Compare October 16, 2026 16:07
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI disposition

Published head: 27f15e58b8ffa0553ea6c02f034b4fe737250181; CI run38923366680. No inherited-failure exception is requested.

Failed job Observed failure Attribution/disposition
checks-node-changed-compact-large-7 /117049670232 Placement hash-memo test expected two removed debug summaries Ours. Preserved the real performance assertions by observing actual worker-returned metrics and remote envelopes in the parked follow-up; removed the now-unread private aggregate entirely. No runtime pass is claimed for that follow-up.
checks-node-changed-7 /117049664175 Gateway node-control-plane beforeAll180000ms timeout;five cases never ran UNKNOWN. No matching baseline signature; local E2E/build replay is outside the campaign host budget. Restore the exact graph-reachable production slice.
checks-node-changed-16 /117049664304 Paired-worker upgrade-wire no-output300000ms watchdog termination143 UNKNOWN. No matching baseline signature; same graph-qualified restore. Load alone is not inherited-red proof.

The failure report also classifies all three as unknown against main run38916811035. Detailed source analysis resolves the first failure as ours; the other two remain unknown. No timeout, retry, skip, suppression or CI rerun was added.

The pinned import walk parsed13015 source files with zero parse errors and retained a positive literal witness for every candidate runtime production path from each failed fixture, including their built CLI subprocesses. That is37 runtime files plus one directly type-imported companion:all32 originally published production files and six new orphan-cleanup owners. This is a measured intersection, not a blanket family rollback or a causal claim. Unresolved/computed edges cannot negate the positive witnesses. Associated tests and the shrink-only assertion allowance must return with their production owners; they do not form a standalone cleanup.

After that restore there is no independent production candidate left to land. Preserve the reviewed proposal on one pushed deslop/z22-parked-runtime-ci-20261015 branch without a PR, then retire the empty publication rather than fabricate a green or merge state. Reconsideration requires attributable head/base Gateway startup and paired-worker upgrade proof under the campaign's permitted environment.

Preservation completed: parked head 32fa48c19b8a4c499832f28b2399bc1a21c0d59d,462 net production lines removed across38 production files. Full candidate patch SHA256 8b316bc58056892ba1806310262e0cae990255791e33e5fa49eea9bb8c599989 matches the independently reviewed working candidate. All five review passes and final source verification completed; the only findings concerned the intermediate index and were resolved by staging the complete unchanged test/aggregate migration together. Normal hooks and signing passed. This is source review, not passing runtime proof or a landable claim.

The publication branch is restored to fresh main 0dc31f5f64309d199f12aea643452bfde54f4888 with zero remaining diff. The exact graph-qualified slice plus its dependent tests/allowance are all the candidate contained; no unrelated production slice was dropped. This PR is withdrawn, not merged.

@RomneyDa
RomneyDa deleted the deslop/z22-15-runtime-agent-traces-20261015 branch October 22, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. security-sensitive-changed size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant