samagotchi 0.171.0 → 0.172.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -1
- data/bin/chi +6 -4
- data/docs/architecture.md +24 -7
- data/docs/bundles.md +4 -21
- data/docs/cli.md +50 -80
- data/docs/configuration.md +11 -13
- data/docs/context.md +5 -6
- data/docs/guardrails.md +57 -96
- data/docs/hooks.md +3 -4
- data/docs/internals/attached-context.md +6 -7
- data/docs/internals/background-tasks.md +4 -3
- data/docs/internals/bridge.md +29 -3
- data/docs/internals/engine.md +21 -9
- data/docs/internals/objectives.md +3 -5
- data/docs/internals/participants.md +118 -143
- data/docs/internals/prompt-caching.md +4 -5
- data/docs/internals/web-frontend.md +33 -14
- data/docs/internals/working-set.md +7 -5
- data/docs/memory.md +1 -1
- data/docs/plugins.md +2 -16
- data/docs/scheduling.md +1 -1
- data/docs/sessions.md +15 -49
- data/docs/sub-agent.md +2 -2
- data/docs/system-one.md +2 -2
- data/docs/testing.md +56 -7
- data/lib/samagotchi/bridge/card_store.rb +1 -0
- data/lib/samagotchi/bridge/sse_writer.rb +1 -0
- data/lib/samagotchi/bridge/turn_accumulator.rb +0 -1
- data/lib/samagotchi/bridge.rb +26 -9
- data/lib/samagotchi/bridge_client/event_stream.rb +2 -0
- data/lib/samagotchi/bundle_command/test_run.rb +1 -0
- data/lib/samagotchi/bundle_command/try/run.rb +1 -0
- data/lib/samagotchi/bundles/coordinator/manifest.yml +4 -5
- data/lib/samagotchi/bundles/coordinator/plugin.rb +6 -79
- data/lib/samagotchi/bundles/coordinator/skill_coordinator.md +1 -16
- data/lib/samagotchi/bundles/github-pr/manifest.yml +2 -2
- data/lib/samagotchi/bundles/github-pr/plugin.rb +0 -1
- data/lib/samagotchi/bundles/inline-widgets/manifest.yml +2 -2
- data/lib/samagotchi/bundles/inline-widgets/plugin.rb +4 -5
- data/lib/samagotchi/bundles/system/manifest.yml +1 -1
- data/lib/samagotchi/client_id.rb +126 -67
- data/lib/samagotchi/command_intake.rb +15 -3
- data/lib/samagotchi/compat.rb +6 -1
- data/lib/samagotchi/context_candidate_choice.rb +1 -3
- data/lib/samagotchi/context_candidates.rb +3 -4
- data/lib/samagotchi/continue_offer.rb +9 -2
- data/lib/samagotchi/delivery.rb +23 -12
- data/lib/samagotchi/empty_answer_error.rb +5 -0
- data/lib/samagotchi/engine/cards.rb +3 -0
- data/lib/samagotchi/engine/context_judge.rb +5 -3
- data/lib/samagotchi/engine/events.rb +4 -0
- data/lib/samagotchi/engine/hooks.rb +3 -0
- data/lib/samagotchi/engine/messages.rb +5 -0
- data/lib/samagotchi/engine/model_settings.rb +2 -0
- data/lib/samagotchi/engine/models.rb +10 -0
- data/lib/samagotchi/engine/objectives.rb +6 -0
- data/lib/samagotchi/engine/participants.rb +18 -14
- data/lib/samagotchi/engine/plugins.rb +8 -0
- data/lib/samagotchi/engine/questions.rb +3 -0
- data/lib/samagotchi/engine/recap.rb +1 -0
- data/lib/samagotchi/engine/session.rb +4 -0
- data/lib/samagotchi/engine/side_requests.rb +9 -0
- data/lib/samagotchi/engine/steering.rb +2 -0
- data/lib/samagotchi/engine/toolkit.rb +5 -0
- data/lib/samagotchi/engine/turn_end.rb +7 -0
- data/lib/samagotchi/engine/turn_helpers.rb +8 -0
- data/lib/samagotchi/engine/verify.rb +2 -0
- data/lib/samagotchi/engine.rb +3 -2
- data/lib/samagotchi/grants.rb +28 -22
- data/lib/samagotchi/guardrail_wiring.rb +23 -18
- data/lib/samagotchi/guardrails/approval_use.rb +59 -0
- data/lib/samagotchi/guardrails/approvals.rb +9 -11
- data/lib/samagotchi/guardrails/child_boundary.rb +1 -0
- data/lib/samagotchi/guardrails/gate.rb +10 -5
- data/lib/samagotchi/guardrails/implicit_writers.rb +1 -0
- data/lib/samagotchi/guardrails/pair_boundary.rb +6 -6
- data/lib/samagotchi/guardrails/participant_refusal.rb +33 -0
- data/lib/samagotchi/guardrails/review_paths.rb +2 -3
- data/lib/samagotchi/guardrails.rb +1 -1
- data/lib/samagotchi/llm_context_strategy.rb +2 -0
- data/lib/samagotchi/objectives.rb +1 -4
- data/lib/samagotchi/objectives_audit.rb +1 -1
- data/lib/samagotchi/objectives_track.rb +1 -1
- data/lib/samagotchi/owner_prompt.rb +3 -6
- data/lib/samagotchi/parent_report.rb +1 -0
- data/lib/samagotchi/participant_messages.rb +9 -4
- data/lib/samagotchi/participant_turn_mode.rb +50 -0
- data/lib/samagotchi/participants.rb +21 -12
- data/lib/samagotchi/participants_watch.rb +2 -2
- data/lib/samagotchi/plugin/api.rb +2 -2
- data/lib/samagotchi/plugin/attached_context.rb +1 -1
- data/lib/samagotchi/plugin/context.rb +0 -4
- data/lib/samagotchi/plugin/sessions.rb +1 -25
- data/lib/samagotchi/run_options.rb +2 -3
- data/lib/samagotchi/send_command.rb +10 -10
- data/lib/samagotchi/session.rb +0 -3
- data/lib/samagotchi/session_access/contract.rb +1 -10
- data/lib/samagotchi/session_access/local.rb +10 -23
- data/lib/samagotchi/session_access/remote.rb +9 -20
- data/lib/samagotchi/session_access.rb +12 -16
- data/lib/samagotchi/session_chain.rb +4 -6
- data/lib/samagotchi/session_commands.rb +6 -3
- data/lib/samagotchi/session_continue.rb +1 -2
- data/lib/samagotchi/session_manager/delivery.rb +25 -5
- data/lib/samagotchi/session_manager/lifecycle.rb +12 -0
- data/lib/samagotchi/session_manager/listing.rb +5 -0
- data/lib/samagotchi/session_manager/spawn.rb +2 -2
- data/lib/samagotchi/session_manager/worker_command.rb +9 -0
- data/lib/samagotchi/session_participants.rb +12 -8
- data/lib/samagotchi/session_review.rb +5 -7
- data/lib/samagotchi/session_stores.rb +3 -3
- data/lib/samagotchi/share_command.rb +10 -12
- data/lib/samagotchi/share_terms.rb +41 -0
- data/lib/samagotchi/steer.rb +8 -14
- data/lib/samagotchi/system_prompt.rb +16 -25
- data/lib/samagotchi/terminal_ui/attach_launcher.rb +2 -1
- data/lib/samagotchi/terminal_ui/attached_loop/exit_commands.rb +1 -0
- data/lib/samagotchi/terminal_ui/attached_loop/queueing.rb +1 -0
- data/lib/samagotchi/terminal_ui/attached_loop/sending.rb +2 -0
- data/lib/samagotchi/terminal_ui/formatting.rb +15 -17
- data/lib/samagotchi/terminal_ui/participant_commands.rb +2 -2
- data/lib/samagotchi/terminal_ui/status_row.rb +2 -2
- data/lib/samagotchi/terminal_ui.rb +1 -2
- data/lib/samagotchi/testing/sessions.rb +2 -10
- data/lib/samagotchi/tool_runner.rb +8 -9
- data/lib/samagotchi/toolkit.rb +4 -22
- data/lib/samagotchi/toolkit_suggest.rb +3 -3
- data/lib/samagotchi/tools/deferred_tools.rb +1 -0
- data/lib/samagotchi/tools/execute.rb +11 -45
- data/lib/samagotchi/tools/leftovers.rb +122 -0
- data/lib/samagotchi/tools/memory.rb +70 -26
- data/lib/samagotchi/tools/task_get.rb +1 -0
- data/lib/samagotchi/tools/task_list.rb +3 -2
- data/lib/samagotchi/tools/task_record.rb +6 -4
- data/lib/samagotchi/tools/task_runtime.rb +199 -20
- data/lib/samagotchi/tools/task_wait.rb +4 -3
- data/lib/samagotchi/turn_context.rb +1 -1
- data/lib/samagotchi/turn_origin.rb +1 -1
- data/lib/samagotchi/turn_stages/context_judge.rb +4 -4
- data/lib/samagotchi/turn_stages/objectives.rb +2 -2
- data/lib/samagotchi/turn_stages/toolkit_suggestion.rb +2 -2
- data/lib/samagotchi/update_hint.rb +3 -1
- data/lib/samagotchi/verify_fresh.rb +1 -1
- data/lib/samagotchi/verify_fresh_origin.rb +13 -11
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/app.rb +3 -5
- data/lib/samagotchi/web/participant_access.rb +14 -18
- data/lib/samagotchi/web/participant_review.rb +3 -4
- data/lib/samagotchi/web/participant_show.rb +4 -3
- data/lib/samagotchi/web/participant_view.rb +3 -3
- data/lib/samagotchi/web/participants_admin.rb +21 -40
- data/lib/samagotchi/web/public/app.js +5 -47
- data/lib/samagotchi/web/public/data.js +2 -10
- data/lib/samagotchi/web/public/delivery_line.js +17 -60
- data/lib/samagotchi/web/public/index.html +10 -30
- data/lib/samagotchi/web/public/live_turn.js +1 -1
- data/lib/samagotchi/web/public/owner_claim.js +2 -2
- data/lib/samagotchi/web/public/participant_bar.js +4 -5
- data/lib/samagotchi/web/public/participant_names.js +14 -10
- data/lib/samagotchi/web/public/participants_panel.js +29 -62
- data/lib/samagotchi/web/public/reload_check.js +2 -3
- data/lib/samagotchi/web/public/send_turn.js +4 -23
- data/lib/samagotchi/web/public/session_actions.js +4 -45
- data/lib/samagotchi/web/public/session_fields.js +0 -1
- data/lib/samagotchi/web/public/session_state.js +0 -3
- data/lib/samagotchi/web/public/session_view.js +2 -3
- data/lib/samagotchi/web/public/settings_panel.js +4 -18
- data/lib/samagotchi/web/public/stage_answer.js +56 -0
- data/lib/samagotchi/web/public/stage_asking.js +1 -1
- data/lib/samagotchi/web/public/stage_cloud.js +93 -0
- data/lib/samagotchi/web/public/stage_dom.js +100 -0
- data/lib/samagotchi/web/public/stage_handoff.js +154 -0
- data/lib/samagotchi/web/public/stage_pager.js +59 -0
- data/lib/samagotchi/web/public/stage_quiet_clock.js +52 -0
- data/lib/samagotchi/web/public/stage_view.js +90 -411
- data/lib/samagotchi/web/public/start_page.js +12 -33
- data/lib/samagotchi/web/public/start_settings.js +24 -78
- data/lib/samagotchi/web/public/start_toolkit.js +6 -10
- data/lib/samagotchi/web/public/stream_handlers.js +1 -9
- data/lib/samagotchi/web/public/turn_block.js +3 -7
- data/lib/samagotchi/web/public/turn_events.js +15 -6
- data/lib/samagotchi/web/public/turn_pieces.js +3 -4
- data/lib/samagotchi/web/public/viewer_self.js +8 -2
- data/lib/samagotchi/web/qr.rb +1 -1
- data/lib/samagotchi/web/session_control.rb +3 -1
- data/lib/samagotchi/web/session_create.rb +5 -71
- data/lib/samagotchi/web/session_summary.rb +1 -4
- data/lib/samagotchi/web/verify_fresh_routes.rb +8 -7
- data/lib/samagotchi/web/viewer.rb +3 -3
- data/lib/samagotchi/worker.rb +16 -14
- data/lib/samagotchi/worker_inbound.rb +4 -3
- data/lib/samagotchi/worker_link.rb +17 -0
- data/lib/samagotchi/working_set.rb +87 -28
- metadata +13 -8
- data/lib/samagotchi/guardrails/review_boundary.rb +0 -99
- data/lib/samagotchi/participant_mode.rb +0 -86
- data/lib/samagotchi/review_apply.rb +0 -131
- data/lib/samagotchi/review_command.rb +0 -123
- data/lib/samagotchi/review_start.rb +0 -196
- data/lib/samagotchi/web/public/review_apply.js +0 -34
- data/lib/samagotchi/web/public/review_start.js +0 -55
|
@@ -13,6 +13,7 @@ require_relative "llm/errors"
|
|
|
13
13
|
require_relative "host_registry"
|
|
14
14
|
require_relative "session"
|
|
15
15
|
require_relative "owner_lock"
|
|
16
|
+
require_relative "empty_answer_error"
|
|
16
17
|
require_relative "bridge/card_store"
|
|
17
18
|
require_relative "bridge/turn_accumulator"
|
|
18
19
|
require_relative "bridge/turn_drawings"
|
|
@@ -47,8 +48,6 @@ module Samagotchi
|
|
|
47
48
|
# this run was asked to use.
|
|
48
49
|
class SessionBusy < StandardError; end
|
|
49
50
|
|
|
50
|
-
EMPTY_ANSWER_ERROR = "chi: the model gave an empty answer"
|
|
51
|
-
|
|
52
51
|
# The session's Engine.
|
|
53
52
|
# @return [Engine]
|
|
54
53
|
attr_reader :engine
|
|
@@ -9,21 +9,19 @@ module Samagotchi
|
|
|
9
9
|
|
|
10
10
|
# ctx.sessions recorded (Plugin::Sessions' methods, same signatures:
|
|
11
11
|
# the contract spec checks): each call lands in #calls and returns a
|
|
12
|
-
# scripted answer (#on), or by default: fork a new id ("fork-1"…),
|
|
13
|
-
# review a new id ("review-1"…), send
|
|
12
|
+
# scripted answer (#on), or by default: fork a new id ("fork-1"…), send
|
|
14
13
|
# and stop the id they got, children [], read raises
|
|
15
14
|
# Plugin::Sessions::Error (no such session).
|
|
16
15
|
#
|
|
17
16
|
# bundle.sessions.on(:children) { |all:| [{ id: "c1", status: "running" }] }
|
|
18
17
|
# bundle.sessions.on(:send) { |id, text, delivery:| raise Samagotchi::Plugin::Sessions::Error, "busy" }
|
|
19
18
|
class Sessions
|
|
20
|
-
METHODS = %i[fork
|
|
19
|
+
METHODS = %i[fork send read children stop].freeze
|
|
21
20
|
|
|
22
21
|
def initialize
|
|
23
22
|
@calls = []
|
|
24
23
|
@scripts = {}
|
|
25
24
|
@forks = 0
|
|
26
|
-
@reviews = 0
|
|
27
25
|
@mutex = Mutex.new
|
|
28
26
|
end
|
|
29
27
|
|
|
@@ -49,12 +47,6 @@ module Samagotchi
|
|
|
49
47
|
end
|
|
50
48
|
end
|
|
51
49
|
|
|
52
|
-
def review(subjects: [], seed: nil, recap_wait: 0)
|
|
53
|
-
answer(:review, [], { subjects: subjects, seed: seed, recap_wait: recap_wait }) do
|
|
54
|
-
"review-#{@mutex.synchronize { @reviews += 1 }}"
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
50
|
def send(id, text, delivery: nil)
|
|
59
51
|
answer(:send, [id, text], { delivery: delivery }) { id }
|
|
60
52
|
end
|
|
@@ -20,7 +20,6 @@ require_relative "config"
|
|
|
20
20
|
require_relative "memory_bundle/index_sync"
|
|
21
21
|
require_relative "memory_bundle/index_size"
|
|
22
22
|
require_relative "memory_bundle/entry_size"
|
|
23
|
-
require_relative "participant_mode"
|
|
24
23
|
|
|
25
24
|
module Samagotchi
|
|
26
25
|
# One call's result from ToolRunner#run, read by ToolResponse (the loops'
|
|
@@ -225,11 +224,13 @@ module Samagotchi
|
|
|
225
224
|
# A memory_read's stamp, one entry per name it read: the file that
|
|
226
225
|
# answered it, and the model overlay read with it when there was one, as
|
|
227
226
|
# they are right after the call:
|
|
228
|
-
# {memories: {name => {path:, mtime_ns:, size:, overlay: {
|
|
229
|
-
#
|
|
230
|
-
#
|
|
231
|
-
#
|
|
232
|
-
#
|
|
227
|
+
# {memories: {name => {path:, mtime_ns:, size:, overlay: {…},
|
|
228
|
+
# requested_scope:, model_key:, fallback_model_key:, project_dir:}}}
|
|
229
|
+
# (no +overlay+ key when no overlay was read). Request metadata lets the
|
|
230
|
+
# working set re-resolve the answer; older path-only stamps compare those
|
|
231
|
+
# paths as before. Nothing at the top carries mtime_ns, so a reader that
|
|
232
|
+
# knows only file stamps (WorkingSet.stamp_of) sees none here, and a
|
|
233
|
+
# session saved before memory stamps has none (compat N-1).
|
|
233
234
|
# nil when the read answered no name (the index listing, every name
|
|
234
235
|
# missing), or none of its files can be stat'd.
|
|
235
236
|
def memory_stamp(result)
|
|
@@ -242,6 +243,7 @@ module Samagotchi
|
|
|
242
243
|
|
|
243
244
|
overlay = stat_entry(read[:overlay_path])
|
|
244
245
|
entry[:overlay] = overlay if overlay
|
|
246
|
+
entry.merge!(read.slice(:requested_scope, :model_key, :fallback_model_key, :project_dir))
|
|
245
247
|
[name, entry]
|
|
246
248
|
end
|
|
247
249
|
entries.empty? ? nil : { memories: entries.to_h }
|
|
@@ -507,9 +509,6 @@ module Samagotchi
|
|
|
507
509
|
end
|
|
508
510
|
|
|
509
511
|
def unreached_group_refusal(call, context)
|
|
510
|
-
# A review turn's boundary denies it first (and words why); a pair
|
|
511
|
-
# turn gets the owner's refusal.
|
|
512
|
-
return if context.participant? && context.participant_mode != ParticipantMode::PAIR
|
|
513
512
|
return if tools.nil?
|
|
514
513
|
|
|
515
514
|
surface = surface(context)
|
data/lib/samagotchi/toolkit.rb
CHANGED
|
@@ -63,9 +63,6 @@ module Samagotchi
|
|
|
63
63
|
FULL = "full"
|
|
64
64
|
LEAN = "lean"
|
|
65
65
|
CHILD = "child"
|
|
66
|
-
# A participant's turn (Guardrails::ReviewBoundary): the name is
|
|
67
|
-
# reserved, so config and plugins can't redefine the boundary.
|
|
68
|
-
REVIEW = "review"
|
|
69
66
|
|
|
70
67
|
# A name that can't be resolved (unknown, a cycle).
|
|
71
68
|
class Unresolved < StandardError; end
|
|
@@ -167,7 +164,7 @@ module Samagotchi
|
|
|
167
164
|
|
|
168
165
|
name = toolkit.name
|
|
169
166
|
seen = []
|
|
170
|
-
until seen.include?(name) ||
|
|
167
|
+
until seen.include?(name) || BUILTIN_KITS.key?(name)
|
|
171
168
|
seen << name
|
|
172
169
|
spec = config[name] || config[name.to_sym]
|
|
173
170
|
break unless spec.is_a?(Hash)
|
|
@@ -233,20 +230,13 @@ module Samagotchi
|
|
|
233
230
|
ask_user_question web_fetch context_read
|
|
234
231
|
].freeze
|
|
235
232
|
|
|
236
|
-
# The built-ins a participant's turn may call (REVIEW): reads only.
|
|
237
|
-
# ReviewBoundary denies everything else, whatever the session declares
|
|
238
|
-
# (D3: the declared tools stay the session's), the forget layer's
|
|
239
|
-
# forget_outputs too (a layer tool, declared with every kit).
|
|
240
|
-
REVIEW_TOOLS = %w[read memory_read].freeze
|
|
241
|
-
|
|
242
233
|
BUILTIN_KITS = [
|
|
243
234
|
Kit.new(name: FULL, tools: :all, groups: :all),
|
|
244
235
|
Kit.new(name: LEAN, tools: LEAN_TOOLS, groups: :all),
|
|
245
236
|
# A delegate child: it reports to its parent (send_note; the
|
|
246
237
|
# delegated-by line names it) and leaves memory writes to it, and
|
|
247
238
|
# starts no children of its own (removed: not even through call_tool).
|
|
248
|
-
Kit.new(name: CHILD, base: LEAN, add: %w[send_note], remove: %w[memory_write delegate delegate_result])
|
|
249
|
-
Kit.new(name: REVIEW, tools: REVIEW_TOOLS, groups: [])
|
|
239
|
+
Kit.new(name: CHILD, base: LEAN, add: %w[send_note], remove: %w[memory_write delegate delegate_result])
|
|
250
240
|
].to_h { |kit| [kit.name, kit] }.freeze
|
|
251
241
|
|
|
252
242
|
# What a toolkit declares, the Registry's filter: every registered tool,
|
|
@@ -365,18 +355,12 @@ module Samagotchi
|
|
|
365
355
|
.with(name: name, prompt: prompt.to_s.empty? ? nil : prompt, groups: groups)
|
|
366
356
|
end
|
|
367
357
|
|
|
368
|
-
# config.yml's toolkit.kits.review, refused: the review kit is the
|
|
369
|
-
# participants' boundary, which config may not widen.
|
|
370
|
-
RESERVED_REVIEW = "toolkit.kits.review: review is reserved for participants' turns (chi share); " \
|
|
371
|
-
"name your kit something else"
|
|
372
|
-
|
|
373
358
|
# The keys a config kit entry takes.
|
|
374
359
|
KIT_KEYS = %w[base add remove prompt groups description].freeze
|
|
375
360
|
|
|
376
361
|
# The kits known: the built-ins, then config's toolkit.kits, then the
|
|
377
362
|
# plugins' (chi.toolkit). A config kit with a built-in's name is left
|
|
378
|
-
# out (one it can't redefine
|
|
379
|
-
# reserved) with a line in +errors+, and so is one
|
|
363
|
+
# out (one it can't redefine) with a line in +errors+, and so is one
|
|
380
364
|
# that isn't a {base:, add:, remove:, prompt:, groups:, description:} map. One with another key
|
|
381
365
|
# (a typo, a tools: list) still loads, with a line naming the key, and
|
|
382
366
|
# so does one whose prompt isn't text or is over PROMPT_MAX characters:
|
|
@@ -392,9 +376,7 @@ module Samagotchi
|
|
|
392
376
|
kits = BUILTIN_KITS.dup
|
|
393
377
|
(config.is_a?(Hash) ? config : {}).each do |name, spec|
|
|
394
378
|
name = name.to_s
|
|
395
|
-
if name
|
|
396
|
-
errors << RESERVED_REVIEW
|
|
397
|
-
elsif kits.key?(name)
|
|
379
|
+
if kits.key?(name)
|
|
398
380
|
errors << "toolkit.kits.#{name}: #{name} is a built-in toolkit"
|
|
399
381
|
elsif !spec.is_a?(Hash)
|
|
400
382
|
errors << "toolkit.kits.#{name}: expected {base:, add:, remove:, prompt:, groups:, description:}"
|
|
@@ -45,12 +45,12 @@ module Samagotchi
|
|
|
45
45
|
Judged = Data.define(:suggestion, :would, :fields)
|
|
46
46
|
|
|
47
47
|
# The candidates with classifier descriptions, excluding the configured
|
|
48
|
-
# default, the
|
|
48
|
+
# default, the defer sentinel, and a
|
|
49
49
|
# kit that doesn't resolve (a missing base, a cycle): it is left out,
|
|
50
50
|
# not the whole ask, and the ≥ 2 clause counts what is left.
|
|
51
51
|
def self.candidates(kits, default_name:)
|
|
52
52
|
kits.values.filter_map do |kit|
|
|
53
|
-
next if [default_name.to_s,
|
|
53
|
+
next if [default_name.to_s, UNDECIDED].include?(kit.name)
|
|
54
54
|
next if kit.description.to_s.empty?
|
|
55
55
|
next unless resolves?(kit.name, kits)
|
|
56
56
|
|
|
@@ -83,7 +83,7 @@ module Samagotchi
|
|
|
83
83
|
# path, when the session already has a model reply.
|
|
84
84
|
def self.eligible?(session:, prompt:, author:, candidate_count:, last_suggestion:, defer_turns:, defer_tokens:)
|
|
85
85
|
return false unless session&.toolkit_origin == "default"
|
|
86
|
-
return false if session.delegate? || !OwnerPrompt.turn?(
|
|
86
|
+
return false if session.delegate? || !OwnerPrompt.turn?(author: author)
|
|
87
87
|
return false unless prompt.is_a?(String) && !prompt.strip.empty?
|
|
88
88
|
return false if value(candidate_count).to_i < 2
|
|
89
89
|
|
|
@@ -5,6 +5,7 @@ require_relative "../config"
|
|
|
5
5
|
require_relative "../log"
|
|
6
6
|
require_relative "../paths"
|
|
7
7
|
require_relative "../process_group"
|
|
8
|
+
require_relative "leftovers"
|
|
8
9
|
require_relative "output_guardrails"
|
|
9
10
|
require_relative "shell"
|
|
10
11
|
require_relative "task_runtime"
|
|
@@ -43,13 +44,11 @@ module Samagotchi
|
|
|
43
44
|
# mode a command at the limit is handed over (HANDED_OVER).
|
|
44
45
|
TIMEOUT_HINT = "(killed at the limit; for a long command use task_create, then task_wait)"
|
|
45
46
|
# How long the output may stay open once the shell has exited: a
|
|
46
|
-
# `server &` child keeps the
|
|
47
|
-
BACKGROUND_GRACE_SEC =
|
|
48
|
-
BACKGROUND_HINT =
|
|
49
|
-
"to keep a server or long job running, start it with task_create)"
|
|
47
|
+
# `server &` child keeps the logs (Leftovers).
|
|
48
|
+
BACKGROUND_GRACE_SEC = Leftovers::GRACE_SEC
|
|
49
|
+
BACKGROUND_HINT = Leftovers.execute_hint(:stopped)
|
|
50
50
|
# It had left the process group (setsid), so it is still running.
|
|
51
|
-
BACKGROUND_DETACHED_HINT =
|
|
52
|
-
"to keep a server or long job running, start it with task_create)"
|
|
51
|
+
BACKGROUND_DETACHED_HINT = Leftovers.execute_hint(:detached)
|
|
53
52
|
# What a command still running at the limit gets (execute.on_timeout):
|
|
54
53
|
# :task hands it over as a task (HANDED_OVER), :kill stops it.
|
|
55
54
|
ON_TIMEOUT = %i[task kill].freeze
|
|
@@ -321,51 +320,18 @@ module Samagotchi
|
|
|
321
320
|
# (`cmd &`) gets BACKGROUND_GRACE_SEC, then its group is stopped
|
|
322
321
|
# (BACKGROUND_HINT), unless it left the group (setsid) and holds them
|
|
323
322
|
# still (BACKGROUND_DETACHED_HINT, left running). One that holds none
|
|
324
|
-
# (`nohup cmd >f 2>&1 &`) is left alone, with no note.
|
|
323
|
+
# (`nohup cmd >f 2>&1 &`) is left alone, with no note (Leftovers.check).
|
|
325
324
|
# @return [Array(Symbol, Symbol|false)] the outcome (:done, :grace,
|
|
326
325
|
# :timeout, :cancelled) and the hint (:stopped, :detached or false)
|
|
327
326
|
def self.background_check(pgid, logs, deadline:, cancelled:)
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
outcome
|
|
331
|
-
return [outcome, false] if outcome == :done
|
|
332
|
-
|
|
333
|
-
# Only the group: the leader's pid is reaped, so it may name another process.
|
|
334
|
-
ProcessGroup.stop(pgid, grace: STOP_GRACE_SEC, poll: STOP_POLL_INTERVAL_SEC, stopped: -> { !held?(logs) })
|
|
335
|
-
return [outcome, false] unless outcome == :grace
|
|
336
|
-
|
|
337
|
-
[outcome, held?(logs) ? :detached : :stopped]
|
|
327
|
+
outcome = Leftovers.check(pgid, logs, grace: BACKGROUND_GRACE_SEC, stop_grace: STOP_GRACE_SEC,
|
|
328
|
+
poll: STOP_POLL_INTERVAL_SEC, deadline: deadline, cancelled: cancelled)
|
|
329
|
+
[outcome.wait, outcome.leftovers || false]
|
|
338
330
|
end
|
|
339
331
|
private_class_method :background_check
|
|
340
332
|
|
|
341
|
-
# Whether some process still has one of +paths+ open from the spawn
|
|
342
|
-
|
|
343
|
-
# fails while any inherited copy is open (~0.2 ms; no lsof, no /proc).
|
|
344
|
-
def self.held?(paths)
|
|
345
|
-
paths.any? do |path|
|
|
346
|
-
File.open(path, "r") do |file|
|
|
347
|
-
got = file.flock(File::LOCK_EX | File::LOCK_NB)
|
|
348
|
-
file.flock(File::LOCK_UN) if got
|
|
349
|
-
!got
|
|
350
|
-
end
|
|
351
|
-
rescue Errno::ENOENT
|
|
352
|
-
false
|
|
353
|
-
end
|
|
354
|
-
end
|
|
355
|
-
|
|
356
|
-
# Polls the logs until no one holds them (+until_time+), the overall
|
|
357
|
-
# +deadline+ or a Stop. Returns :done, :grace, :timeout or :cancelled.
|
|
358
|
-
def self.await_release(paths, until_time:, deadline:, cancelled:)
|
|
359
|
-
loop do
|
|
360
|
-
return :done unless held?(paths)
|
|
361
|
-
return :cancelled if cancelled.call
|
|
362
|
-
return :timeout if deadline && monotonic_time > deadline
|
|
363
|
-
return :grace if monotonic_time > until_time
|
|
364
|
-
|
|
365
|
-
sleep(STOP_POLL_INTERVAL_SEC)
|
|
366
|
-
end
|
|
367
|
-
end
|
|
368
|
-
private_class_method :await_release
|
|
333
|
+
# Whether some process still has one of +paths+ open from the spawn (Leftovers.held?).
|
|
334
|
+
def self.held?(paths) = Leftovers.held?(paths)
|
|
369
335
|
|
|
370
336
|
# The whole log when it is under execute.truncate_at_bytes, else its
|
|
371
337
|
# head and tail only, read by seek (never the whole 100 MB).
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../process_group"
|
|
4
|
+
|
|
5
|
+
module Samagotchi
|
|
6
|
+
module Tools
|
|
7
|
+
# What a command's shell left running once it exited (`server &`), the
|
|
8
|
+
# rule execute applies (and task_create's tasks): chi holds the
|
|
9
|
+
# command's logs with a shared flock across the spawn, so every process
|
|
10
|
+
# the command started inherits them, and a fresh exclusive flock fails
|
|
11
|
+
# while any of them still has one open (held?). A holder gets a grace,
|
|
12
|
+
# then the command's group is stopped; one that left the group (setsid)
|
|
13
|
+
# and still holds them is out of reach and left running; one that holds
|
|
14
|
+
# none (`nohup cmd >f 2>&1 &`) was never in question.
|
|
15
|
+
module Leftovers
|
|
16
|
+
# How long the logs may stay held once the shell has exited.
|
|
17
|
+
GRACE_SEC = 1.5
|
|
18
|
+
POLL_SEC = 0.05
|
|
19
|
+
|
|
20
|
+
# What a check found and did. +wait+: :done (nothing held, or released
|
|
21
|
+
# within the grace), :grace (the grace ran out: the group was
|
|
22
|
+
# stopped), :timeout (the caller's deadline), :cancelled (its Stop).
|
|
23
|
+
# +leftovers+: :stopped, :detached (a holder outside the group, left
|
|
24
|
+
# running) or nil (nothing to say).
|
|
25
|
+
Outcome = Data.define(:wait, :leftovers)
|
|
26
|
+
|
|
27
|
+
# The hint's two endings, by what happened to the holder.
|
|
28
|
+
WHAT = { stopped: "was stopped", detached: "was left running" }.freeze
|
|
29
|
+
# What each tool's hint tells the model to do instead. Never just
|
|
30
|
+
# "with task_create": a `server &` there is stopped too. The task
|
|
31
|
+
# side never says "use task_create" (that is how it got there), and a
|
|
32
|
+
# holder left running is told how to end it.
|
|
33
|
+
EXECUTE_ADVICE = "to keep a server or long job running, start it with task_create in the foreground (no `&`)"
|
|
34
|
+
TASK_ADVICE = {
|
|
35
|
+
stopped: "to keep one running, run it in the foreground or end the command with `wait`",
|
|
36
|
+
detached: "it left the task's process group, so task_stop can't reach it: kill it if it shouldn't run; " \
|
|
37
|
+
"next time, run it in the foreground or end the command with `wait`"
|
|
38
|
+
}.freeze
|
|
39
|
+
|
|
40
|
+
module_function
|
|
41
|
+
|
|
42
|
+
# A tool's hint for +kind+ (:stopped, :detached): +held+ names what
|
|
43
|
+
# the process kept open ("the output", "the task's log"), +advice+
|
|
44
|
+
# what to do instead. The wording lives here, for every tool.
|
|
45
|
+
def hint(kind, held:, advice:) = "(a background process kept #{held} open and #{WHAT.fetch(kind)}; #{advice})"
|
|
46
|
+
|
|
47
|
+
# execute's hint (Execute::BACKGROUND_HINT, BACKGROUND_DETACHED_HINT).
|
|
48
|
+
def execute_hint(kind) = hint(kind, held: "the output", advice: EXECUTE_ADVICE)
|
|
49
|
+
|
|
50
|
+
# A task's hint (TaskRuntime.leftovers_note: task_get, task_wait, the
|
|
51
|
+
# finish note, task_list).
|
|
52
|
+
def task_hint(kind) = hint(kind, held: "the task's log", advice: TASK_ADVICE.fetch(kind))
|
|
53
|
+
|
|
54
|
+
# After the shell exited: a holder of +logs+ gets +grace+, then the
|
|
55
|
+
# group +pgid+ is stopped (stop_group), unless the deadline or
|
|
56
|
+
# +cancelled+ came first.
|
|
57
|
+
# @return [Outcome]
|
|
58
|
+
def check(pgid, logs, grace:, stop_grace:, poll:, deadline:, cancelled:)
|
|
59
|
+
return Outcome.new(wait: :done, leftovers: nil) unless held?(logs)
|
|
60
|
+
|
|
61
|
+
wait = await_release(logs, until_time: monotonic + grace, deadline: deadline, cancelled: cancelled, poll: poll)
|
|
62
|
+
return Outcome.new(wait: wait, leftovers: nil) if wait == :done
|
|
63
|
+
|
|
64
|
+
found = stop_group(pgid, logs, grace: stop_grace, poll: poll)
|
|
65
|
+
Outcome.new(wait: wait, leftovers: wait == :grace ? found : nil)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Stops what is left of the group +pgid+ once its leader is dead and
|
|
69
|
+
# reaped: TERM, +grace+, KILL (ProcessGroup.stop, the groups its
|
|
70
|
+
# members started too). Only while the group still has members: a pgid
|
|
71
|
+
# isn't reused while its group has any (POSIX), so they are the
|
|
72
|
+
# command's; logs held with the group empty mean a holder that left it
|
|
73
|
+
# (setsid), and nothing is signalled. Done once the group is empty or
|
|
74
|
+
# nothing holds the logs, so no KILL goes out to an emptied group.
|
|
75
|
+
# @param kill_wait [Numeric, nil] ProcessGroup.stop's (nil: its default)
|
|
76
|
+
# @return [Symbol, nil] :stopped, :detached when the logs are still
|
|
77
|
+
# held, nil when the group was empty and nothing holds them (an
|
|
78
|
+
# earlier held? that read another probe's lock: nothing to say)
|
|
79
|
+
def stop_group(pgid, logs, grace:, poll:, kill_wait: nil)
|
|
80
|
+
alive = ProcessGroup.group_alive?(pgid)
|
|
81
|
+
if alive
|
|
82
|
+
options = kill_wait ? { kill_wait: kill_wait } : {}
|
|
83
|
+
ProcessGroup.stop(pgid, grace: grace, poll: poll, quiet: ProcessGroup::QUIET,
|
|
84
|
+
stopped: -> { !ProcessGroup.group_alive?(pgid) || !held?(logs) }, **options)
|
|
85
|
+
end
|
|
86
|
+
return :detached if held?(logs)
|
|
87
|
+
|
|
88
|
+
alive ? :stopped : nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Whether some process still has one of +paths+ open from the spawn:
|
|
92
|
+
# a flock belongs to the open file description, so an exclusive try
|
|
93
|
+
# fails while any inherited copy is open (~0.2 ms; no lsof, no /proc).
|
|
94
|
+
def held?(paths)
|
|
95
|
+
paths.any? do |path|
|
|
96
|
+
File.open(path, "r") do |file|
|
|
97
|
+
got = file.flock(File::LOCK_EX | File::LOCK_NB)
|
|
98
|
+
file.flock(File::LOCK_UN) if got
|
|
99
|
+
!got
|
|
100
|
+
end
|
|
101
|
+
rescue Errno::ENOENT
|
|
102
|
+
false
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Polls the logs until no one holds them (+until_time+), the overall
|
|
107
|
+
# +deadline+ or a Stop. Returns :done, :grace, :timeout or :cancelled.
|
|
108
|
+
def await_release(paths, until_time:, deadline:, cancelled:, poll: POLL_SEC)
|
|
109
|
+
loop do
|
|
110
|
+
return :done unless held?(paths)
|
|
111
|
+
return :cancelled if cancelled.call
|
|
112
|
+
return :timeout if deadline && monotonic > deadline
|
|
113
|
+
return :grace if monotonic > until_time
|
|
114
|
+
|
|
115
|
+
sleep(poll)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def monotonic = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -26,11 +26,11 @@ module Samagotchi
|
|
|
26
26
|
SEPARATOR = "\n\n---\n\n"
|
|
27
27
|
|
|
28
28
|
# A memory_read's text, and which file answered each name it read
|
|
29
|
-
# (+reads+: name => {path:, overlay_path
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
29
|
+
# (+reads+: name => {path:, overlay_path:, requested_scope:, model_key:,
|
|
30
|
+
# fallback_model_key:, project_dir:}, absolute paths, the overlay only
|
|
31
|
+
# when one was read with the entry). A String, so every reader of the
|
|
32
|
+
# result reads the same bytes the model does; ToolRunner turns +reads+
|
|
33
|
+
# into the run's stamp (ToolRunner#memory_stamp).
|
|
34
34
|
class Result < String
|
|
35
35
|
attr_reader :reads
|
|
36
36
|
|
|
@@ -40,6 +40,58 @@ module Samagotchi
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
Resolved = Data.define(:scope, :path, :overlay_path, :overlay_key)
|
|
44
|
+
|
|
45
|
+
# The entry and overlay that would answer +name+ from these explicit
|
|
46
|
+
# memory roots. Nil when no entry exists.
|
|
47
|
+
def self.resolve(name, project_dir:, system_dir:, scope: nil, model_key: nil, fallback_model_key: nil)
|
|
48
|
+
name = name.to_s.strip
|
|
49
|
+
return nil if name.empty? || invalid_name?(name)
|
|
50
|
+
|
|
51
|
+
scope = normalize_scope(scope)
|
|
52
|
+
roots = { "project" => project_dir, "system" => system_dir }
|
|
53
|
+
scopes = scope ? [scope] : %w[project system]
|
|
54
|
+
scopes.each do |resolved_scope|
|
|
55
|
+
root = roots[resolved_scope]
|
|
56
|
+
next unless root
|
|
57
|
+
|
|
58
|
+
path = File.join(root, "#{name}.md")
|
|
59
|
+
next unless File.exist?(path)
|
|
60
|
+
|
|
61
|
+
overlay_path = overlay_key = nil
|
|
62
|
+
[model_key, fallback_model_key].compact.each do |candidate|
|
|
63
|
+
key = candidate.to_s.strip
|
|
64
|
+
next if key.empty?
|
|
65
|
+
|
|
66
|
+
candidate_path = File.join(root, "#{name}.#{key}.md")
|
|
67
|
+
next unless File.exist?(candidate_path)
|
|
68
|
+
|
|
69
|
+
overlay_path = candidate_path
|
|
70
|
+
overlay_key = key
|
|
71
|
+
break
|
|
72
|
+
end
|
|
73
|
+
return Resolved.new(scope: resolved_scope, path: path, overlay_path: overlay_path, overlay_key: overlay_key)
|
|
74
|
+
end
|
|
75
|
+
nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.overlay_prefix(key) = "#{SEPARATOR}Model-specific guidance (#{key}):\n"
|
|
79
|
+
|
|
80
|
+
def self.append_overlay(body, overlay_text, key) = "#{body}#{overlay_prefix(key)}#{overlay_text}"
|
|
81
|
+
|
|
82
|
+
def self.overlay_key(name, path)
|
|
83
|
+
basename = File.basename(path.to_s)
|
|
84
|
+
prefix = "#{name}."
|
|
85
|
+
return nil unless basename.start_with?(prefix) && basename.end_with?(".md")
|
|
86
|
+
|
|
87
|
+
basename.delete_prefix(prefix).delete_suffix(".md")
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def self.overlay_tail(text, key)
|
|
91
|
+
at = text.to_s.rindex(overlay_prefix(key))
|
|
92
|
+
at ? text[at..] : ""
|
|
93
|
+
end
|
|
94
|
+
|
|
43
95
|
# @param fallback_model_key [String, nil] read when +model_key+ has no overlay
|
|
44
96
|
def self.call(entry_name, scope: nil, model_key: nil, fallback_model_key: nil)
|
|
45
97
|
entry_name = entry_name.to_s.strip
|
|
@@ -73,30 +125,22 @@ module Samagotchi
|
|
|
73
125
|
results = []
|
|
74
126
|
reads = {}
|
|
75
127
|
missing = []
|
|
128
|
+
project_dir = memories_dir("project") unless scope == "system"
|
|
129
|
+
system_dir = memories_dir("system") unless scope == "project"
|
|
76
130
|
|
|
77
131
|
names.each do |name|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
body = File.read(path, encoding: "UTF-8")
|
|
84
|
-
overlay = nil
|
|
85
|
-
# Append model-specific overlay if key is provided and overlay exists.
|
|
86
|
-
[model_key, fallback_model_key].compact.each do |key|
|
|
87
|
-
overlay_path = ModelOverlay.overlay_path_for(name, key, resolved_scope)
|
|
88
|
-
next unless overlay_path && File.exist?(overlay_path)
|
|
89
|
-
|
|
90
|
-
body += SEPARATOR + "Model-specific guidance (#{key}):\n" + File.read(overlay_path, encoding: "UTF-8")
|
|
91
|
-
overlay = overlay_path
|
|
92
|
-
break
|
|
93
|
-
end
|
|
94
|
-
results << body
|
|
95
|
-
reads[name] = { path: path, overlay_path: overlay }
|
|
96
|
-
found = true
|
|
97
|
-
break
|
|
132
|
+
resolved = resolve(name, scope: scope, model_key: model_key, fallback_model_key: fallback_model_key,
|
|
133
|
+
project_dir: project_dir, system_dir: system_dir)
|
|
134
|
+
unless resolved
|
|
135
|
+
missing << name
|
|
136
|
+
next
|
|
98
137
|
end
|
|
99
|
-
|
|
138
|
+
|
|
139
|
+
body = File.read(resolved.path, encoding: "UTF-8")
|
|
140
|
+
body = append_overlay(body, File.read(resolved.overlay_path, encoding: "UTF-8"), resolved.overlay_key) if resolved.overlay_path
|
|
141
|
+
results << body
|
|
142
|
+
reads[name] = { path: resolved.path, overlay_path: resolved.overlay_path, requested_scope: scope,
|
|
143
|
+
model_key: model_key, fallback_model_key: fallback_model_key, project_dir: project_dir }
|
|
100
144
|
end
|
|
101
145
|
|
|
102
146
|
return Result.new(results.join(SEPARATOR), reads) if missing.empty?
|
|
@@ -33,6 +33,7 @@ module Samagotchi
|
|
|
33
33
|
"output_path: #{record.output_path}",
|
|
34
34
|
# A handed-over execute's stderr has a log of its own.
|
|
35
35
|
("stderr_path: #{record.stderr_path}" if record.stderr_path),
|
|
36
|
+
TaskRuntime.leftovers_note(record),
|
|
36
37
|
(TaskRuntime::USER_STOP_NOTE if record.stopped_by_user?)
|
|
37
38
|
].compact.join("\n")
|
|
38
39
|
end
|
|
@@ -26,8 +26,9 @@ module Samagotchi
|
|
|
26
26
|
"pid: #{record.pid}",
|
|
27
27
|
"created_at: #{record.created_at}",
|
|
28
28
|
"command: #{preview(record.command)}",
|
|
29
|
-
"output_path: #{record.output_path}"
|
|
30
|
-
|
|
29
|
+
"output_path: #{record.output_path}",
|
|
30
|
+
TaskRuntime.leftovers_note(record)
|
|
31
|
+
].compact.join("\n")
|
|
31
32
|
end
|
|
32
33
|
private_class_method :format_entry
|
|
33
34
|
|
|
@@ -11,14 +11,16 @@ module Samagotchi
|
|
|
11
11
|
# The file keeps its key order (the members' order) and leaves out the
|
|
12
12
|
# optional keys while unset: +stderr_path+ and +handed_over_by+ (only a
|
|
13
13
|
# handed-over execute has them) and +stop_requested_by+ (only once a
|
|
14
|
-
# stop started)
|
|
14
|
+
# stop started) and +leftovers+ ("stopped" or "detached": what its
|
|
15
|
+
# shell left holding the log when it exited, Leftovers). bundles/slow-commands
|
|
16
|
+
# reads these files on its own.
|
|
15
17
|
TaskRecord = Data.define(
|
|
16
18
|
:metadata_version, :id, :command, :cwd, :workspace_root, :status, :pid, :pid_started,
|
|
17
19
|
:created_at, :started_at, :finished_at, :exit_code, :stop_reason,
|
|
18
|
-
:output_path, :stderr_path, :exit_code_path, :handed_over_by, :stop_requested_by
|
|
20
|
+
:output_path, :stderr_path, :exit_code_path, :handed_over_by, :stop_requested_by, :leftovers
|
|
19
21
|
) do
|
|
20
22
|
self::METADATA_VERSION = 1
|
|
21
|
-
self::OPTIONAL = %i[stderr_path handed_over_by stop_requested_by].freeze
|
|
23
|
+
self::OPTIONAL = %i[stderr_path handed_over_by stop_requested_by leftovers].freeze
|
|
22
24
|
|
|
23
25
|
# A record for a task that just started (task_create), or that an
|
|
24
26
|
# execute hands over (TaskRuntime.adopt fills in +pid_started+ then).
|
|
@@ -28,7 +30,7 @@ module Samagotchi
|
|
|
28
30
|
new(metadata_version: self::METADATA_VERSION, id: id, command: command, cwd: cwd, workspace_root: Dir.pwd,
|
|
29
31
|
status: "running", pid: pid, pid_started: pid_started, created_at: started_at, started_at: started_at,
|
|
30
32
|
finished_at: nil, exit_code: nil, stop_reason: nil, output_path: output_path, stderr_path: stderr_path,
|
|
31
|
-
exit_code_path: exit_code_path, handed_over_by: handed_over_by, stop_requested_by: nil)
|
|
33
|
+
exit_code_path: exit_code_path, handed_over_by: handed_over_by, stop_requested_by: nil, leftovers: nil)
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
# @param data [Hash] the parsed task.json; a key it lacks reads nil
|