claude-usage-limits 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "usage-limits",
3
3
  "displayName": "Usage Limits",
4
- "version": "1.16.0",
4
+ "version": "1.17.0",
5
5
  "description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
6
6
  "author": {
7
7
  "name": "Ridelink",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usage-limits",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Reports how much of your Codex usage limit is left as turns of work rather than a percentage, prices a job before you start it, and counts the other agents sharing the same budget.",
5
5
  "author": {
6
6
  "name": "Ridelink",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-usage-limits",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
5
5
  "keywords": [
6
6
  "claude",
@@ -552,8 +552,12 @@ function briefText(parts) {
552
552
  // The command, in the host's own vocabulary. /effort does not exist
553
553
  // in Codex, and naming it there is telling Codex to do nothing while
554
554
  // believing it acted.
555
+ // The host this line is being written FOR, not whatever the process
556
+ // happens to be set to. Reading global state here meant the sentence
557
+ // was only accidentally right, and a caller that built a line for
558
+ // the other host got a command that does not exist there.
555
559
  (warning.cheaper && warning.cheaper.effort
556
- ? ' To drop it: ' + usage.levers(usage.currentHost()).effort(warning.cheaper.effort) + '.'
560
+ ? ' To drop it: ' + usage.levers(parts.host || usage.currentHost()).effort(warning.cheaper.effort) + '.'
557
561
  : '')
558
562
  );
559
563
  }
@@ -717,7 +721,15 @@ function briefText(parts) {
717
721
  // that is a real session: the Fable weekly hit 89 per cent, the line said
718
722
  // the budget was nearly gone, and the work ended with the five-hour window
719
723
  // at 46 and every other model untouched.
720
- escapeText && (parts.pressure === 'tight' || parts.pressure === 'gone')
724
+ // Only a MODEL switch survives to 'gone'. It retires a scoped window
725
+ // outright, so the budget really is still there. Effort does not: a
726
+ // cheaper turn against an exhausted window is still a turn you cannot
727
+ // take, and telling a session at 100 per cent that it is "not out of
728
+ // budget" because medium is cheaper than high would be this plugin
729
+ // producing the exact failure it exists to prevent, in reverse - refusing
730
+ // to stop at the one moment stopping is right.
731
+ escapeText &&
732
+ (parts.pressure === 'tight' || (parts.pressure === 'gone' && escape && escape.kind === 'model'))
721
733
  ? 'This window is nearly gone, but you are not out of budget and you must ' +
722
734
  'not stop as though you were. ' + escapeText + ' Do that, say in one ' +
723
735
  'line that you switched and why, and carry on with the whole request at ' +
@@ -1055,6 +1067,7 @@ async function run(now, hookInput) {
1055
1067
  : null,
1056
1068
  othersSummary: view.othersSummary,
1057
1069
  escape: view.escape || null,
1070
+ host: usage.currentHost(),
1058
1071
  turnsLeft: view.turnsLeft,
1059
1072
  effortWarning: view.effortWarning || null,
1060
1073
  // Outside the cache: it is cheap, and it belongs to the other agent's