Skip to content

[dead-code] chore: remove dead functions — 2 functions removed - #65621

Merged
pelikhan merged 1 commit into
mainfrom
chore/remove-dead-functions-37213835402-bef4169132e8d065
Oct 4, 2026
Merged

pelikhan merged 1 commit into
mainfrom
chore/remove-dead-functions-37213835402-bef4169132e8d065

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Functions Removed

Function File
CodexEngine.extractCodexTokenUsage pkg/workflow/codex_logs.go
GetLogParserBootstrap pkg/workflow/js.go

Tests Removed

  • TestCodexExtractTokenUsageTotalTokensPattern
  • TestGetLogParserBootstrap

Verification

  • go build ./...
  • go vet ./... (pkg/workflow)
  • go vet -tags=integration ./... (pkg/workflow)
  • make fmt

Note: go test ./pkg/workflow/ has 6 pre-existing failures that also occur without this change.

https://github.com/github/gh-aw/actions/runs/37213835402

Generated by 🧹 Dead Code Removal Agent · copilot · auto · 25.9 AIC · ⌖ 10.7 AIC · ⊞ 9.8K · ◷

  • expires on Oct 7, 2026, 7:51 AM UTC-08:00

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 4, 2026 16:03
Copilot AI balanced review requested due to automatic review settings October 4, 2026 16:03
@pelikhan
pelikhan merged commit 25c15e6 into main Oct 4, 2026
10 checks passed
@pelikhan
pelikhan deleted the chore/remove-dead-functions-37213835402-bef4169132e8d065 branch October 4, 2026 16:03
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #65621

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Comment Memory

reviewed_at: 2026-10-04T16:05:55Z
review_event: COMMENT
top_themes:
  - stale exported API documentation after symbol removal
files_reviewed:
  - pkg/workflow/codex_engine.go
  - pkg/workflow/codex_logs.go
  - pkg/workflow/codex_total_tokens_test.go
  - pkg/workflow/js.go
  - pkg/workflow/js_test.go
comment_count: 1

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 22.3 AIC · ⌖ 7.2 AIC · ⊞ 19.4K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

Non-blocking, but this dead-code cleanup leaves one stale reference behind.

Themes
  • pkg/workflow/README.md still advertises GetLogParserBootstrap even though this PR deletes the function. That leaves the exported API inventory out of sync with the code and sends future readers/tooling toward a symbol that no longer exists.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 22.3 AIC · ⌖ 7.2 AIC · ⊞ 19.4K
Comment /review to run again

Comments that could not be inline-anchored

pkg/workflow/js.go:23

Removing GetLogParserBootstrap without updating pkg/workflow/README.md leaves the exported API inventory pointing at a symbol that no longer exists, which is exactly the kind of stale reference dead-code cleanup should remove in the same PR.

<details><summary>💡 Keep the API inventory in sync with the code removal</summary>

pkg/workflow/README.md still lists GetLogParserBootstrap at line 1412. Please delete that row here so repo docs and any tooling built from that inventory do not im…

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Removing the documented exported bootstrap function breaks the public Go API without a compatibility or major-version plan.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Removes two functions identified as dead code and their obsolete tests.

Changes:

  • Removes an unused Codex token-usage wrapper.
  • Removes the exported log-parser bootstrap stub.
  • Deletes associated tests and implementation comments.
File Description
pkg/​workflow/​js.go Removes bootstrap stub.
pkg/​workflow/​js_test.go Removes bootstrap test.
pkg/​workflow/​codex_logs.go Removes unused Codex wrapper.
pkg/​workflow/​codex_total_tokens_test.go Removes wrapper-specific tests.
pkg/​workflow/​codex_engine.go Removes obsolete implementation comment.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/workflow/js.go
Comment on lines 29 to 31
func GetReadBufferScript() string {
return ""
}

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Clean, mechanical dead-code removal — no skill-specific issues found.

📋 Analysis

Change type

Pure deletion (0 additions, 63 deletions across 5 files). No new abstractions, no behavior change, and no bug being fixed, so /tdd, /diagnosing-bugs, /codebase-design, and /improve-codebase-architecture do not surface meaningful findings here.

Verification performed

  • Confirmed CodexEngine.extractCodexTokenUsage and GetLogParserBootstrap have zero remaining references anywhere in the Go codebase.
  • Ran go build ./... — succeeds.
  • Ran go vet ./... — clean.
  • Corresponding unit tests (TestCodexExtractTokenUsageTotalTokensPattern, TestGetLogParserBootstrap) were removed alongside the dead functions, keeping test/code parity.
  • codex_logs.go's remaining extractCodexLegacyTokenCount (the real logic extractCodexTokenUsage used to wrap) is still present and exercised by TestCodexParseLogMetricsLegacyTokenSnapshots.

Positive highlights

  • ✅ Comment references updated in codex_engine.go (stale // extractCodexTokenUsage is implemented in codex_logs.go pointer removed) rather than left dangling.
  • ✅ Tests removed in lockstep with the functions they covered — no orphaned test failures introduced.

No blocking issues. Approving.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 17.9 AIC · ⌖ 14.3 AIC · ⊞ 10K
Comment /matt to run again

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.91.0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants