Skip to content

Docs: Say what Claude Code's disable restores, and drop the fixed #1289 issue - #1675

Merged
huang195 merged 3 commits into
rossoctl:mainfrom
huang195:docs/claude-code-940
Nov 6, 2026
Merged

huang195 merged 3 commits into
rossoctl:mainfrom
huang195:docs/claude-code-940

Conversation

@huang195

@huang195 huang195 commented Nov 6, 2026

Copy link
Copy Markdown
Member

Closes #940.

What it does

docs/agents/claude-code.md:

How #940's open items close

Item Result
install.sh --claude-code on 4 targets Dropped. The install is no longer specific to Claude Code.
Revert restores the file byte for byte Changed to "restores every value". A probe test (enable, then disable) gave the same values, with sorted keys and a new indent.
Regression test for #926 TestForwardProxy_Streaming_HeartbeatDeliveredWhileUpstreamOpen shows that Cortex relays a ping while the upstream stays open. #926 stopped because of a gateway change, not a Cortex change.
No behaviour change after the agent-contract refactor Moved to #939, which has not done the refactor.

Assisted-By: Claude (Anthropic AI) [email protected]

…soctl#1289 issue

disable restores every value, but it writes the file again with sorted
keys and a 2-space indent. Say so, and point to settings.json.bak for
the original bytes.

rossoctl#1343 fixed rossoctl#1289: disable now does not change a key that changed after
enable. Remove it from Known issues and describe the new behaviour.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>
@huang195
huang195 requested a review from a team as a code owner November 6, 2026 17:59
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b9f94631-6ee1-41a0-ab4b-d47c3c0a5f9d
Commits

Reviewing files that changed from the base of the PR and between 180d388 and ce411a6.

Files selected for processing: 3

  • cmd/agentop/cmd_codex.go
  • docs/agents/claude-code.md
  • docs/agents/codex.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Fixes review:
- settings.json.bak holds the file from before the first enable, not later edits
- disable also splits arrays and escapes &, < and >, not only key order and indent
- Codex docs and comment no longer name the closed rossoctl#1289 as the tracker

Files:
- cmd/agentop/cmd_codex.go
- docs/agents/claude-code.md
- docs/agents/codex.md

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>

@clawgenti clawgenti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

I checked the doc changes against the code at the head commit and they hold up. #1289 is closed as completed, fixed by #1343 (merged 2026-10-12, first released in v0.9.0). changedSinceEnable and printClaudeCodeLeft do what the new paragraph says. writeSettings uses json.MarshalIndent(doc, "", " "), so the output has sorted keys and a 2-space indent. TestClaudeCodeDisable_LeavesAKeyChangedSinceEnable and TestForwardProxy_Streaming_HeartbeatDeliveredWhileUpstreamOpen both exist. Nothing blocks merge. I left three suggestions inline: two caveats the new wording leaves out, and one about how far settings.json.bak can be trusted.

One follow-up outside this diff: docs/agents/codex.md (lines 72 and 81) still says the "did this change since enable" comparison "is tracked by #1289". That issue is now closed and the fix only covers Claude Code, so that page should name a new issue or say Codex does not have the check.

Author: huang195 (MEMBER — maintainer)
Areas reviewed: Docs (checked against cmd/agentop/cmd_claudecode.go, cmd_uninstall.go, setup_files.go, setup_step_claudecode.go)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes. Nit: the subject is 77 characters, over the 72 guideline.
CI status: DCO, pre-commit and PR-title checks pass. Some Go jobs are still pending, but this PR changes docs only.

`~/.cortex/claude-code-state.json`. `disable` removes only the keys `enable` added, and
puts back any value it recorded. `agentop uninstall` runs the same `disable`.
puts back any value it recorded. It does not change a key whose value changed after
`enable`, and it names each key it did not change. `agentop uninstall` runs the same `disable`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: This is true only when the record has Written. changedSinceEnable returns false (meaning "not changed") when there is no record, or when the record was written before #1343. In those cases disable still removes the key or restores Prior over the edit, which is the old #1289 behaviour. That covers a record from v0.8.x where neither enable nor setup --claude-code has run since the upgrade (topUpWritten only fills Written in on a no-change re-run), and also an install where writing the record failed. Consider adding something like: "This needs a record written by v0.9.0 or later; re-running enable adds it to an older one."

Nit: "names each key" is exact for configure claude-code disable, but agentop uninstall goes through claudeCodeLeftNote → someKeys, which names three keys and then prints ….

Comment thread docs/agents/claude-code.md Outdated
puts back any value it recorded. It does not change a key whose value changed after
`enable`, and it names each key it did not change. `agentop uninstall` runs the same `disable`.

`disable` restores every value, but not the file's layout. It writes the keys in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: Two small accuracy points.

  1. enable changes the layout too, not only disable. Both go through writeSettings → json.MarshalIndent, so the file is already reformatted after the first enable.
  2. Key order and indent are not the only byte changes. MarshalIndent escapes HTML characters, so &, < and > in any string come back as \u0026, \u003c and \u003e. That is common in Claude Code hooks and statusLine commands: a && b 2>/dev/null becomes a \u0026\u0026 b 2\u003e/dev/null. The values stay JSON-equal, so "restores every value" still holds, but a reader who sees that escaping would not expect it from this sentence. (Strictly, numbers also go through float64, so 1.50 becomes 1.5, and an emptied "env": {} is dropped rather than put back. These are edge cases and may not be worth mentioning.)

Suggested wording: "enable and disable keep every value but rewrite the file: keys in alphabetical order, a 2-space indent, and &, <, > written as \u0026-style escapes."

Comment thread docs/agents/claude-code.md Outdated
`enable`, and it names each key it did not change. `agentop uninstall` runs the same `disable`.

`disable` restores every value, but not the file's layout. It writes the keys in
alphabetical order with a 2-space indent. For the original bytes, use `settings.json.bak`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: backupOnce writes settings.json.bak on the first write ever and never refreshes it, even across later disable/enable cycles. So it holds the original bytes only if nothing else in settings.json changed after that first enable. Copying it back throws away every later change: new permissions, MCP servers, other env entries. Worth saying, e.g. "…use settings.json.bak, the file as it was before the first enable; copying it back also undoes any change made since."

Fixes review: the list of rewrites is not complete (numbers, non-ASCII, duplicate keys also change)
Files:
- docs/agents/claude-code.md

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>

@clawgenti clawgenti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

I re-reviewed at ce411a6. Two of my three earlier suggestions are addressed, and so is the codex.md follow-up. The rewrite list now names the array split and the \u0026-style escapes. The settings.json.bak sentence now says what the backup does and does not hold. docs/agents/codex.md and the applyCodexDisable comment no longer point at #1289. The codex wording ("Unlike Claude Code's disable, it does not check...") matches the code: the codex record has no Written.

I checked the main claims at the head commit:

  • #1289 is fixed. I ran a probe: enable, hand-edit HTTPS_PROXY, then disable. disable kept the edit, removed the other six keys, and printed Leaving these alone — changed since Cortex set them: HTTPS_PROXY.
  • What disable restores. A probe from {"zeta":1.50,"hooks":{"cmd":"a && b 2>/dev/null"},"arr":[1,2],...} came back sorted, with a 2-space indent, [1, 2] split across lines, \u0026\u0026 and \u003e, and 1.5. .bak held the original bytes.

I left two suggestions inline. One is still open from the last review: with a pre-v0.9.0 record, a hand-edit is still removed, and I confirmed that with a probe. Neither blocks merge.

Author: huang195 (MEMBER — maintainer)
Areas reviewed: Docs, Go comment (checked against cmd_claudecode.go, cmd_uninstall.go, setup_files.go, setup_step_claudecode.go, cmd_codex.go)
Agent/IDE config (.claude/.vscode): none
Commits: 3 commits, all signed-off: yes. Nit: the first subject is 77 characters, over the 72 guideline.
CI status: all checks pass, except Go CI (core peerproc, macOS), which is still pending. This PR changes no code.

`~/.cortex/claude-code-state.json`. `disable` removes only the keys `enable` added, and
puts back any value it recorded. `agentop uninstall` runs the same `disable`.
puts back any value it recorded. It does not change a key whose value changed after
`enable`, and it names each key it did not change. `agentop uninstall` runs the same `disable`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion (still open from the last review): This holds only when the record has Written. I ran a probe at ce411a6: enable, remove written from the state file (what a v0.8.x record looks like), hand-edit HTTPS_PROXY, then disable. The result was {}. The edit was removed with no Leaving these alone line, because changedSinceEnable returns false when nothing is recorded. An upgrade through install.sh tops Written up (claudeCodeStep.already → topUpWritten), so the gap is narrow. Still, with #1289 now gone from Known issues, nothing says it exists. One sentence would cover it, e.g. "This needs a record from v0.9.0 or later; re-running enable or agentop setup adds it to an older one."

Nit: "names each key" is exact for configure claude-code disable. agentop uninstall uses someKeys, which names three keys and then prints ….

puts back any value it recorded. It does not change a key whose value changed after
`enable`, and it names each key it did not change. `agentop uninstall` runs the same `disable`.

`disable` restores every value, but not the file's text. For example, it sorts the keys, uses a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: Two small points about this paragraph.

  1. enable rewrites the file the same way, through the same writeSettings → json.MarshalIndent. So the reformatting a reader sees comes from the first enable, not from disable. Saying "enable and disable keep every value but rewrite the file's text" would place it right. That also exposes a mismatch outside this diff: the enable prompt says Nothing else in the file changes; a copy is kept as …bak (cmd_claudecode.go:556). That is true of values but not of bytes. This could be a follow-up.
  2. "Every value" has one exception: integers above 2^53 go through float64. In a Go probe, 9007199254740993 came back as 9007199254740992. That is very unlikely in settings.json, so it may not be worth a word here, beyond the "For example" you already have.

@huang195
huang195 merged commit b0eb36d into rossoctl:main Nov 6, 2026
59 of 60 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 6, 2026
@huang195
huang195 deleted the docs/claude-code-940 branch November 6, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feature: Claude Code — verify and harden the reference integration for v0.9.0

2 participants