Skip to content

Add railway ca manage, fix --refresh-auth cache, add setup reset - #1076

Merged
codyde merged 4 commits into
masterfrom
railway/ca-manage-reset-refresh-auth
Aug 11, 2026
Merged

Add railway ca manage, fix --refresh-auth cache, add setup reset#1076
codyde merged 4 commits into
masterfrom
railway/ca-manage-reset-refresh-auth

Conversation

@codyde

@codyde codyde commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three related railway ca fixes:

  • railway ca manage — a new subcommand that opens the TUI directly on the manage screen, skipping the front-door menu (browse_into generalizes the existing browse() to accept an initial screen).
  • --refresh-auth cache bug — previously it only skipped the remote reuse check on an existing agent; the local ~/.railway/claude-code-token cache was still read first in claude_credentials_cheap, so a stale/revoked cached token could never actually be replaced. It now clears the local cache before falling through to a fresh mint.
  • railway ca setup --reset — clears saved cloud agent preferences (~/.railway/agent-prefs.json) and the cached Claude token together. Also available as a "Reset to default" choice in the interactive prompts when existing preferences are found.

Test plan

  • cargo test --bin railway commands::cloud_agent — 235 passed, including new setup::tests::reset_* tests
  • cargo test --bin railway commands::code:: — 19 passed
  • cargo fmt / cargo clippy --bin railway clean on touched files
  • Manual smoke test: railway ca setup --reset against a scratch $HOME — removes agent-prefs.json and claude-code-token, confirmed via --show afterward reporting "No cloud agent preferences yet"
  • railway ca --help lists the new manage subcommand

@codyde codyde added the release/skip Author no release label Aug 11, 2026
@codyde
codyde force-pushed the railway/ca-manage-reset-refresh-auth branch from 37d832f to ddac4d1 Compare August 11, 2026 04:53
@codyde
codyde changed the base branch from master to railway/settings-menu August 11, 2026 04:54
@codyde
codyde force-pushed the railway/settings-menu branch from afa9c4f to 7ccbd80 Compare August 11, 2026 04:57
@codyde
codyde force-pushed the railway/ca-manage-reset-refresh-auth branch from ddac4d1 to 238c6ca Compare August 11, 2026 04:57
@codyde
codyde changed the base branch from railway/settings-menu to master August 11, 2026 05:05
@codyde codyde closed this Aug 11, 2026
@codyde codyde reopened this Aug 11, 2026
@codyde
codyde force-pushed the railway/ca-manage-reset-refresh-auth branch from 238c6ca to c835c7b Compare August 11, 2026 05:15
@codyde codyde removed the release/skip Author no release label Aug 11, 2026
@codyde codyde added release/minor Author minor release release/skip Author no release labels Aug 11, 2026 — with Railway App
@codyde codyde removed the release/minor Author minor release label Aug 11, 2026
@codyde
codyde changed the base branch from master to railway/settings-menu August 11, 2026 05:29
@codyde codyde removed the release/skip Author no release label Aug 11, 2026
@codyde codyde added the release/minor Author minor release label Aug 11, 2026 — with Railway App
@codyde
codyde force-pushed the railway/settings-menu branch from 04e4ed8 to 2007c25 Compare August 11, 2026 05:56
Base automatically changed from railway/settings-menu to master August 11, 2026 05:58
codyde added 4 commits August 11, 2026 05:58
`railway ca manage` jumps the TUI straight to the manage screen, skipping
the front-door menu. `--refresh-auth` now clears the local Claude
setup-token cache before re-minting, instead of only skipping the
remote reuse check (a stale/revoked cached token previously never got
replaced). `railway ca setup --reset`, and a "Reset to default" choice
in the interactive prompts, clear saved cloud agent preferences and the
cached token together.
Scrolling was clamped to one screenful — a documented workaround for
vt100 0.15's view composition underflowing past the screen height.
vt100 0.16 fixes that, and ratatui 0.30 (via ratatui-core) drops the
exact unicode-width pin that blocked the upgrade.

Bump both, migrate the moved Parser::set_size/set_scrollback calls to
Screen, drop the one-page ceilings in scroll_by and resize, and pin the
behavior with tests: full-depth scroll, multi-notch wheel walks, deep
offsets across resizes, churn (output + scroll + reshape interleaved),
retention-limit clamping, and a full-frame render from deep history.
* Unlock full scrollback depth in railway ca session panes

Scrolling was clamped to one screenful — a documented workaround for
vt100 0.15's view composition underflowing past the screen height.
vt100 0.16 fixes that, and ratatui 0.30 (via ratatui-core) drops the
exact unicode-width pin that blocked the upgrade.

Bump both, migrate the moved Parser::set_size/set_scrollback calls to
Screen, drop the one-page ceilings in scroll_by and resize, and pin the
behavior with tests: full-depth scroll, multi-notch wheel walks, deep
offsets across resizes, churn (output + scroll + reshape interleaved),
retention-limit clamping, and a full-frame render from deep history.

* feat(ca): add Opt+[ to cycle back to the previous session

Opt+] already cycles forward through open session panes; this adds the
reverse chord. Opt+[ is recognized where the terminal can express it
unambiguously: as a real ALT event under the kitty keyboard protocol
(which the TUI already enables), or as the composed curly double quote
macOS sends when Option is not mapped to Meta.

Under legacy Option-as-Meta, Opt+[ is the two bytes ESC [ — identical to
the CSI prefix every arrow key starts with — so it never surfaces as a
key event there. The chord goes dead in those terminals but can never
misfire or steal a cursor key.

Also updates the footer hint to advertise both directions.
* Unlock full scrollback depth in railway ca session panes

Scrolling was clamped to one screenful — a documented workaround for
vt100 0.15's view composition underflowing past the screen height.
vt100 0.16 fixes that, and ratatui 0.30 (via ratatui-core) drops the
exact unicode-width pin that blocked the upgrade.

Bump both, migrate the moved Parser::set_size/set_scrollback calls to
Screen, drop the one-page ceilings in scroll_by and resize, and pin the
behavior with tests: full-depth scroll, multi-notch wheel walks, deep
offsets across resizes, churn (output + scroll + reshape interleaved),
retention-limit clamping, and a full-frame render from deep history.

* feat(ca): add Opt+[ to cycle back to the previous session

Opt+] already cycles forward through open session panes; this adds the
reverse chord. Opt+[ is recognized where the terminal can express it
unambiguously: as a real ALT event under the kitty keyboard protocol
(which the TUI already enables), or as the composed curly double quote
macOS sends when Option is not mapped to Meta.

Under legacy Option-as-Meta, Opt+[ is the two bytes ESC [ — identical to
the CSI prefix every arrow key starts with — so it never surfaces as a
key event there. The chord goes dead in those terminals but can never
misfire or steal a cursor key.

Also updates the footer hint to advertise both directions.

* Lead the ca Manage tree with agents instead of projects

The Manage screen is about cloud agents, but they rendered at depth 3 of a
workspace > project > environment > agent > session tree — two container
levels to expand before reaching the thing the screen exists to show, with
the environment level almost always a single-child passthrough.

Invert the presentation: every environment that has agents is promoted to an
always-expanded top-level group, labelled with its project (plus /env when
the environment isn't production and the project has several). Agents render
directly beneath with their status glyphs, sessions still nested under their
agent. Groups sort by liveliness — anything running floats up — then default
project, then name; the cursor is anchored by row identity so re-sorts never
move the selection.

Projects with agent-less environments wait in a collapsible "other projects"
tail, default project first and undimmed. The tail opens itself while there
are no agents to show (so a fresh account still gets the browse tree, behind
a hint) and folds away once groups exist; toggling it by hand sticks. Every
environment stays reachable there for n, t, and r — including empty ones in
projects whose other environments have agents.

Refreshes no longer blank a loaded environment while the reply is in flight,
so groups stay put through the wake/sleep watch polls, and a failed refresh
keeps the stale list with the error in the status line instead of hiding
agents that exist. The data model and RowKind index tuples are unchanged —
this is a rework of the rows() flattener, the expansion handlers, and the
rendering; myCloudAgents already delivered everything at startup.
@codyde
codyde force-pushed the railway/ca-manage-reset-refresh-auth branch from 50c0d67 to cb3ecaf Compare August 11, 2026 06:02
@codyde
codyde merged commit f5d59ad into master Aug 11, 2026
9 checks passed
@codyde
codyde deleted the railway/ca-manage-reset-refresh-auth branch August 11, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant