You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome back to another dramatic episode of “What Fresh Tech Debt Is This?” 🎭 The repo is mostly solid, but the few warts it has are… artisanally crafted. We’ve got delete-happy reverts, logging that screams the wrong way, a directory scanner that bravely spelunks into Mordor, and a .gitignore surgeon who only stitches the first incision and leaves the rest gaping. Buckle up. 💥
☠️ Revert happily targets config.toml, which can be a legit project file, not Ruler’s plaything.
The “additional files” purge literally includes plain config.toml. This is not a niche filename — it’s ubiquitous. Removing it when there’s no .bak is a footgun.
OpenHands uses config.toml by design, but this blanket list doesn’t check provenance. Accidental data loss after a trial run? Chef’s kiss of chaos. 💣
case'Open Hands':
// For Open Hands, we target the main config file, not a separate mcp.jsoncandidates.push(path.join(projectRoot,'config.toml'));
Suggestions
Only delete files that:
Have a Ruler provenance marker (write one when created).
Or have a .bak right next to them.
Or are enumerated in an “apply manifest” captured earlier.
Gate config.toml removal behind: “contains OpenHands MCP section(s) we wrote” or a .bak.
Add a --force-extra-cleanup flag for risky deletions; otherwise log a warning and skip.
Dry‑Run Prefix Bug Prints Function Source 🤦
🗯️ In dry-run cleanup of VSCode settings, you log ${actionPrefix} (the function) instead of the computed prefix string. Enjoy your log of “function actionPrefix(dry: boolean) { … }”.
Files
src/core/revert-engine.ts
Code
Wrong interpolation (uses function instead of call):
Change logVerbose to console.log to match the contract.
Add a small logging test suite to lock down streams and prefixes.
Recursive .ruler Scan Dives Into node_modules
🕳️ findAllRulerDirs recursively traverses the whole tree, skipping only “dot” directories. So yes, it will joyride through node_modules, vendor, dist, etc., looking for .ruler. Why.
if(trimmed===RULER_START_MARKER&&!processedFirstBlock){inFirstRulerBlock=true;hasRulerBlock=true;newLines.push(line);// Add the new Ruler pathsrulerPaths.forEach((p)=>newLines.push(p));continue;}// ...if(!inFirstRulerBlock){newLines.push(line);}// Skip lines that are in the first Ruler block (they get replaced)
Strip all existing RULER blocks and write a single new block at the end.
Add a test with multiple pre-existing blocks to assert idempotence.
MCP Reader Swallows Parse Errors And Misreads Non‑JSON
🙈 readNativeMcp uses JSON.parse and returns {} on error, silently. If a file is borked, you should at least whisper about it. Also: this will happily “parse” TOML targets if misrouted.
Log a verbose warning on parse failure with the file path.
Detect format by extension; only JSON.parse for .json files.
Add a thin schema validation for expected keys; fail fast on nonsense.
CLI Exits The Process; Please Stop Killing The Host App
🪓 process.exit(1) is fine for a stubby binary, but you’ve got nicely exportable handlers, and then you slam the door shut. Great for tests? Nope. Great for embedding? Double nope.
Throw and let the top-level bin catch-and-exit. Keep handlers pure.
Return non-zero exit codes via the actual CLI entrypoint only.
Add tests that call handlers and assert on thrown errors rather than abrupt exits.
Agent Name Matching For MCP Paths Is Fragile
🧩 getNativeMcpPath switches on display names (e.g., “GitHub Copilot” vs identifiers). If an agent renames itself for branding, poof — path resolution breaks.
Switch by agent.getIdentifier() or centralize a single mapping between identifier → path candidates.
Add a test verifying getNativeMcpPath stays stable with cosmetic name changes.
If you fix just three things, make it: the revert deletion list (stop nuking config.toml), the dry-run logging bug (no more function-to-string comedy), and the directory traversal (don’t spelunk node_modules). Your future self will send you cupcakes. Or, at least, fewer angry commit messages. 🎂🔥
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This Codebase Smells!
Welcome back to another dramatic episode of “What Fresh Tech Debt Is This?” 🎭 The repo is mostly solid, but the few warts it has are… artisanally crafted. We’ve got delete-happy reverts, logging that screams the wrong way, a directory scanner that bravely spelunks into Mordor, and a
.gitignore
surgeon who only stitches the first incision and leaves the rest gaping. Buckle up. 💥Table of Contents
Overzealous Revert Deletes Real Files
☠️ Revert happily targets
config.toml
, which can be a legit project file, not Ruler’s plaything.config.toml
. This is not a niche filename — it’s ubiquitous. Removing it when there’s no.bak
is a footgun.config.toml
by design, but this blanket list doesn’t check provenance. Accidental data loss after a trial run? Chef’s kiss of chaos. 💣Files
src/core/revert-engine.ts
src/paths/mcp.ts
src/core/apply-engine.ts
(OpenHands TOML propagation)Code
config.toml
:Suggestions
.bak
right next to them.config.toml
removal behind: “contains OpenHands MCP section(s) we wrote” or a.bak
.--force-extra-cleanup
flag for risky deletions; otherwise log a warning and skip.Dry‑Run Prefix Bug Prints Function Source 🤦
🗯️ In dry-run cleanup of VSCode settings, you log
${actionPrefix}
(the function) instead of the computed prefix string. Enjoy your log of “function actionPrefix(dry: boolean) { … }”.Files
src/core/revert-engine.ts
Code
Suggestions
${actionPrefix}
with the localprefix
variable oractionPrefix(dryRun)
.Verbose Logging Sends To Stderr (Contradicting Its Own Doc)
📣 The comment promises “info/verbose go to stdout”… then
logVerbose
sends to stderr. Pick a lane.Files
src/constants.ts
Code
// - info/verbose go to stdout (user-visible progress)
Suggestions
logVerbose
toconsole.log
to match the contract.Recursive .ruler Scan Dives Into node_modules
🕳️
findAllRulerDirs
recursively traverses the whole tree, skipping only “dot” directories. So yes, it will joyride throughnode_modules
,vendor
,dist
, etc., looking for.ruler
. Why.Files
src/core/FileSystemUtils.ts
Code
.
:Suggestions
node_modules
,dist
,build
,coverage
,target
,vendor
,.next
,.turbo
,.yarn
, etc..gitignore
during traversal; or provide a--max-depth
for hierarchical search..gitignore Block Replacement Leaves Duplicates
🧵 You replace only the first “RULER block” and leave any older blocks intact. Congrats on layered duplication. Future archaeologists will thank you.
Files
src/core/GitignoreUtils.ts
Code
Suggestions
MCP Reader Swallows Parse Errors And Misreads Non‑JSON
🙈
readNativeMcp
usesJSON.parse
and returns{}
on error, silently. If a file is borked, you should at least whisper about it. Also: this will happily “parse” TOML targets if misrouted.Files
src/paths/mcp.ts
src/core/apply-engine.ts
(uses read/write helpers)Code
Suggestions
JSON.parse
for.json
files.CLI Exits The Process; Please Stop Killing The Host App
🪓
process.exit(1)
is fine for a stubby binary, but you’ve got nicely exportable handlers, and then you slam the door shut. Great for tests? Nope. Great for embedding? Double nope.Files
src/cli/handlers.ts
Code
Suggestions
bin
catch-and-exit. Keep handlers pure.Agent Name Matching For MCP Paths Is Fragile
🧩
getNativeMcpPath
switches on display names (e.g., “GitHub Copilot” vs identifiers). If an agent renames itself for branding, poof — path resolution breaks.Files
src/paths/mcp.ts
src/agents/*
(source of names vs identifiers)Code
Suggestions
agent.getIdentifier()
or centralize a single mapping between identifier → path candidates.getNativeMcpPath
stays stable with cosmetic name changes.If you fix just three things, make it: the revert deletion list (stop nuking
config.toml
), the dry-run logging bug (no more function-to-string comedy), and the directory traversal (don’t spelunknode_modules
). Your future self will send you cupcakes. Or, at least, fewer angry commit messages. 🎂🔥Beta Was this translation helpful? Give feedback.
All reactions