tinker-agent 1.0.0 → 1.0.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinker-agent",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Tinker Agent Runner",
5
5
  "bin": {
6
6
  "tinker-agent": "./run-tinker-agent.rb"
@@ -205,18 +205,22 @@ def attach_to_agent(agent_type, config)
205
205
  puts "📎 Attaching to #{agent_type} agent..."
206
206
 
207
207
  # Determine the user to attach as
208
- # We assume the agent is running as the user with the same UID as the host user
209
- # (since that's how we build the image)
210
- uid = Process.uid
211
- user = `docker exec #{container_name} getent passwd #{uid} | cut -d: -f1`.strip
208
+ # First try to detect the user the container is running as
209
+ user = `docker exec #{container_name} whoami 2>/dev/null`.strip
212
210
 
213
211
  if user.empty?
214
- # Fallback to 'claude' if detection fails (e.g. different UID mapping)
215
- puts "⚠️ Could not detect agent user for UID #{uid}, defaulting to 'claude'"
216
- user = "claude"
212
+ # Fallback: try to match host UID
213
+ uid = Process.uid
214
+ user = `docker exec #{container_name} getent passwd #{uid} | cut -d: -f1`.strip
215
+ end
216
+
217
+ if user.empty?
218
+ # Fallback: default to rails (standard for this image)
219
+ user = "rails"
220
+ puts "⚠️ Could not detect agent user, defaulting to '#{user}'"
217
221
  end
218
222
 
219
- puts " User: #{user} (UID: #{uid})"
223
+ puts " User: #{user}"
220
224
 
221
225
  # Attach to agent session which has the status bar
222
226
  # Must run as agent user since tmux server runs under that user