Skip to content

fix(chat): save permission choices with the host clock - #28593

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/jira-validation-clock
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/jira-validation-clock

Conversation

@nwparker

@nwparker nwparker commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by current main: the production clock fix and stronger regression coverage already landed. structured-agent-session-permission-mode.test.ts verifies the host timestamp, no extra agent acquisition, and persistence across restart. The remaining test duplicates that coverage; this PR is closed without merging.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

Changing a chat’s permission choice could fail because the save path forgot the clock it needs. This passes the execution host’s clock through so the choice saves correctly.

What Changed

Add the existing host clock to the session-option context. A regression exercises the real session host and record store, checks the permission and timestamp, and confirms the change does not start another agent.

Why

The permission save path already requires this clock. Supplying it fixes the runtime failure and the base type error without changing option rules or adding another clock.

Linked Issue

Found while validating the Jira backlog. No existing issue covers this small prerequisite.

Visual Proof

N/A — repairs a missing context member; no layout or control changes.

Testing

  • Automated tests: new regression fails on the unchanged base with ctx.now is not a function; 11 focused permission/message-option tests pass with the fix.
  • Full pnpm tc passes.
  • Changed-code quality gate passes; commit hooks format and lint the two changed files.
  • Live agent permission change on other platforms; CI covers broader checks.

Review

The execution host continues to own persistence and timestamps. No provider, SSH, platform or wire behavior changes.

Agent skill upstream boundary

  • Not applicable; no upstream skill code copied.

Notes

Merge risk: Low. One missing context member, verified through the real host/store. Jira branches can be validated with this prerequisite without mixing it into their feature diffs.

Checklist

  • Small and focused
  • Explained user behavior, mechanism and approach
  • Visual proof applicability explained
  • Self-reviewed
  • Cross-platform and remote authority considered
  • Focused tests, typecheck and changed quality gate pass; broader build checks go to CI

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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 11 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe4359bf-f5e2-48c7-8909-c2c47305bd89
📥 Commits

Reviewing files that changed from the base of the PR and between 5e1c117 and 22e6855.

📒 Files selected for processing: 2
  • src/main/native-chat/agent-session-wire/structured-agent-session-message-options.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-permission-clock.test.ts
  • 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

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant