fix runtime exceptions surfaced when the editor opens

Now that the editor split actually opens (T-197), it exposed latent
issues, plus a coincidental Claude-session crash in the same log:

- T-203: the _EditorDragHandle's slider Semantics had value +
  onIncrease/onDecrease but no increased/decreasedValue, so Flutter
  asserted on every semantics flush — add them. And opening the split
  reparented the Claude pane (direct child → Column/Expanded), tearing
  down its SelectableRegion mid selection-update ('selectable not in
  this registrar' / 'inactive element'); a stable GlobalKey on the
  workspace primary makes Flutter move the element instead.
- T-202: rate_limit_event.resetsAt arrives as a unix-epoch number but
  was cast `as String?`, throwing in the stream-json line parser. Accept
  a num (epoch) or an ISO string.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 18:49:09 +02:00
co-authored by Claude Opus 4.8
parent 740cc7bb7b
commit 2e323990df
6 changed files with 57 additions and 12 deletions
@@ -271,6 +271,18 @@ void main() {
expect(statuses.last.rateLimitInfo, contains('rate limited'));
expect(statuses.last.rateLimitInfo, contains('resets'));
});
test('rate_limit_event with a numeric (epoch) resetsAt does not crash', () async {
// Claude sends resetsAt as a unix-epoch number, not a string — the
// old `as String?` cast threw 'int is not a subtype of String?'.
proc.emit(jsonEncode({
'type': 'rate_limit_event',
'rate_limit_info': {'status': 'rate_limited', 'resetsAt': 1780000000},
}));
await Future<void>.delayed(Duration.zero);
expect(statuses.last.rateLimitInfo, contains('rate limited'));
expect(statuses.last.rateLimitInfo, contains('resets'));
});
});
group('token streaming via stream_event (T-168, shape verified by T-184)', () {