Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/claw/tui/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module TUI
# Implements Bubbletea's init/update/view protocol.
class Model
attr_reader :runtime, :chat_history, :mode, :chat_viewport, :executor, :textarea,
:baseline_methods, :input_history, :zone
:baseline_methods, :baseline_vars, :input_history, :zone
attr_accessor :chat_ratio, :dragging_divider

def initialize(caller_binding)
Expand All @@ -56,6 +56,11 @@ def initialize(caller_binding)
rescue
[]
end
@baseline_vars = begin
caller_binding.local_variables.map(&:to_s)
rescue
[]
end

# Bubbles components
@chat_viewport = Bubbles::Viewport.new(width: 80, height: 20)
Expand Down
18 changes: 10 additions & 8 deletions lib/claw/tui/status_panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ module StatusPanel
def self.render(model, width, height)
sections = []

sections << render_binding(model, width - 4)
sections << render_snapshots(model, width - 4)
sections << render_memory(model, width - 4)
sections << render_tokens(model, width - 4)
sections << render_status(model, width - 4)
sections << render_binding(model, width - 2)
sections << render_snapshots(model, width - 2)
sections << render_memory(model, width - 2)
sections << render_tokens(model, width - 2)
sections << render_status(model, width - 2)

# Truncate content to fit within available height
all_lines = sections.join("\n").split("\n")
Expand All @@ -27,7 +27,9 @@ def self.render_binding(model, width)
return "#{header}\n (not tracked)" unless binding_res

lines = [header]
binding_res.tracked.each do |name, blob|
baseline = model.baseline_vars || []
user_vars = binding_res.tracked.reject { |name, _| baseline.include?(name) }
user_vars.each do |name, blob|
val = begin
v = MarshalMd.load(blob)
"#{v.class} (#{summary_value(v)})"
Expand All @@ -37,7 +39,7 @@ def self.render_binding(model, width)
line = " #{name}: #{val}"
lines << truncate(line, width)
end
lines << " (empty)" if binding_res.tracked.empty?
lines << " (empty)" if user_vars.empty?

# Show user-defined methods (only those added during session)
begin
Expand Down Expand Up @@ -81,7 +83,7 @@ def self.render_memory(model, width)
count = memory.long_term.size
lines = [header, " #{count} facts"]
memory.long_term.last(3).each do |m|
lines << " · #{truncate(m[:content].to_s, width - 4)}"
lines << " · #{truncate(m[:content].to_s, width - 2)}"
end
lines.join("\n")
end
Expand Down
2 changes: 1 addition & 1 deletion lib/claw/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module Claw
VERSION = "0.2.2"
BUILD = "20260407-014"
BUILD = "20260407-015"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

BUILD 常量日期不匹配

BUILD 常量显示的日期为 20260407(4月7日),但此 PR 是在 2026-04-08 创建的。根据编码规范,BUILD 应该反映代码更改时的日期,并且每天的序列号从 001 开始重新计数。

🔧 建议的修复
-  BUILD = "20260407-015"
+  BUILD = "20260408-001"

基于编码规范:"Increment the BUILD constant in lib/claw/version.rb every time you change code, using format YYYYMMDD-NNN where NNN is a sequential number starting at 001 each day"

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
BUILD = "20260407-015"
BUILD = "20260408-001"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/claw/version.rb` at line 5, The BUILD constant in lib/claw/version.rb is
dated 20260407-015 but the PR is from 2026-04-08; update the BUILD value to
reflect the PR date using the YYYYMMDD-NNN format and restart the daily sequence
at 001 (i.e., change BUILD to "20260408-001"); ensure you edit the BUILD
constant in the Version file (BUILD in lib/claw/version.rb) accordingly.

end
Loading