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
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ def _read_progress_notes():
tally(turn_counts, "stance_offered")
# What the message is doing beside its mood (backend/utils/message_doing.py): joking through it, winding down, asking, telling news. Only where the emotional guidance is in force
# (a plain turn already answers the question first), and never under a safety plan.
_doing = message_doing.kind(_their_words) if (view_wanted and emotional_context and not safety_plan.active) else None
_doing = message_doing.kind(_their_words, effective_intensity(final_state.get("emotional_state"), datetime.now(timezone.utc))) if (view_wanted and emotional_context and not safety_plan.active) else None
if _doing:
prompt = prompt + message_doing.build_block(_doing)
tally(turn_counts, "doing", _doing)
Expand Down Expand Up @@ -2283,7 +2283,7 @@ def _read_progress_notes():
ai_message.additional_kwargs[view_check.VIEW_MARK] = True
tally(turn_counts, "view_stated")
if not is_guest_username(username) and get_db() is not None:
spawn_background_task(asyncio.to_thread(own_views.note, get_db(), username, _their_words, plain_quotes(full_response)))
spawn_background_task(asyncio.to_thread(own_views.note, get_db(), username, plain_quotes(full_response)))
tally(turn_counts, "own_view_kept")
if view_asked and view_check.hands_back(plain_quotes(full_response)):
tally(turn_counts, "view_handed_back")
Expand Down
4 changes: 2 additions & 2 deletions backend/components/sonic_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@
"month": "2026-11",
"title": "I check a change right after you apply it",
"line": (
"Right after you apply a change I made, I run the one check of yours that fits it (its own tests, or the type check) and fix what it finds in the same turn. Turn on \"Check my changes right after I apply them\" for your runner and it runs without a click."
"After you apply a change I made, I run your own check that fits it and fix what it finds. Turn on \"Check my changes right after I apply them\" and it runs without a click, unless I read outside text like a web page that turn."
),
"keywords": ["check after apply", "run the tests after", "type check after", "verify my change", "check my changes", "after edit check"],
"volunteer": [],
Expand Down Expand Up @@ -2121,7 +2121,7 @@
"month": "2026-11",
"title": "Reading what a message is doing",
"line": (
"When you're having a hard time I now notice whether a message is joking through it, heading to bed, asking me something or telling me news, and I answer that first."
"When you're having a rough time, short of something heavy, I now notice whether a message is joking through it, heading to bed, asking me something or telling me news, and I answer that first."
),
"keywords": ["joking", "going to bed", "news", "asked a question", "answer first", "attune"],
"volunteer": [],
Expand Down
5 changes: 5 additions & 0 deletions backend/services/agent_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4051,6 +4051,11 @@ async def _after_edit_check(changed: list) -> str:
if not runner_jobs.settings_of(runner_for_checks)["after_edit_auto"]:
await asyncio.to_thread(record_turn_counts, {"code_after_edit_check_suggested": 1})
return after_edit_check.suggestion(choice)
held = after_edit_check.held_back(choice, changed, runner_jobs.runnable_checks(runner_for_checks),
read_others_text=bool(untrusted_used & _THIRD_PARTY_TEXT_TOOLS))
if held:
await asyncio.to_thread(record_turn_counts, {"code_after_edit_check_held": 1})
return after_edit_check.suggestion(choice) + f" It did not run by itself because {held}. Say so in one sentence."
db = get_db()
try:
job = await asyncio.to_thread(runner_jobs.create_job, db, username, runner_for_checks["id"], choice["check"], choice["files"], None, runner_for_checks.get("project_id"), True)
Expand Down
8 changes: 4 additions & 4 deletions backend/services/native_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

from langchain_core.messages import HumanMessage, SystemMessage, ToolMessage

from backend.utils import act_not_suggest, advisor as advisor_module, answer_checks, claim_check, combo as combo_rules, diff_review, draft_checkpoint, handback_check, loop_progress, loop_rhythm, multi_read, reading_waste
from backend.utils import act_not_suggest, advisor as advisor_module, after_edit_check, answer_checks, claim_check, combo as combo_rules, diff_review, draft_checkpoint, handback_check, loop_progress, loop_rhythm, multi_read, reading_waste
from backend.utils.log_hygiene import describe_tool_result
from backend.utils.prompt_meter import PromptMeter
from backend.utils.agent_utils import _UnsafeActionRequested, build_tool_facts, build_trace_subject, new_trace_step_id
Expand Down Expand Up @@ -666,7 +666,7 @@ def required_done() -> bool:
outcome = await run_checkpoint(step - 1)
if outcome == "answered" and handback_in_scope() and (handed_back := handback_check.kind(
final_text or "", coding_turn=claim_checking, edited=edited_this_turn(), offered=offered, steps_left=budget - step + 1,
checked=any(str(a.get("action_desc", "")).startswith(("run_local_check(", "run_local_command(", "run_sandbox_tests(")) for a in attempts), check_failed=handback_check.last_check_failed(attempts))) and handback_check.may_send_back(answer_sent_back, handed_back):
checked=handback_check.check_ran(attempts), check_failed=handback_check.last_check_failed(attempts))) and handback_check.may_send_back(answer_sent_back, handed_back):
# An answer at the checkpoint used to end the turn with no check at all (2026-11-27: after an applied edit, "The morph still isn't wired ... it needs a new request", 13 steps left). It is held to the
# same hand-back rule as any answer.
messages.append(HumanMessage(content=send_back_handback(handed_back, budget - step + 1)))
Expand Down Expand Up @@ -749,7 +749,7 @@ def required_done() -> bool:
notice = answer_checks.NO_READ_NOTICE
elif handback_in_scope() and (handed_back := handback_check.kind(
answer, coding_turn=claim_checking, edited=edited_this_turn(), offered=offered, steps_left=budget - step,
checked=any(str(a.get("action_desc", "")).startswith(("run_local_check(", "run_local_command(", "run_sandbox_tests(")) for a in attempts), check_failed=handback_check.last_check_failed(attempts))) and handback_check.may_send_back(answer_sent_back, handed_back):
checked=handback_check.check_ran(attempts), check_failed=handback_check.last_check_failed(attempts))) and handback_check.may_send_back(answer_sent_back, handed_back):
# The answer ends by offering to carry on, saying the work is not finished, or telling the person to run it themselves, with steps left and the tools to do it (backend/utils/handback_check.py):
# sent back, and an "unfinished" or "offer" one again while it keeps saying so (up to handback_check.MAX_REPEATS: 2026-11-27, one send-back was not enough).
notice = send_back_handback(handed_back, budget - step)
Expand Down Expand Up @@ -826,7 +826,7 @@ def required_done() -> bool:
fed = HumanMessage(content=block)
messages.append(fed)
held.append({"message": fed, "step": step, "text": block, "done": False, "key": f"plan_feed|{step}"})
if after_apply_hint and applied_now and not more_plan_steps:
if after_apply_hint and applied_now and not more_plan_steps and not any(after_edit_check.finished_in(result) for result in results):
# An edit was just applied: say what to do next (check it, or write the test it needs first), from the server, so it is not left to the model to remember. Not while an approved plan still has
# steps to go: its tests are usually a later step, and a check run before they exist can only fail or run nothing (Jack, 2026-10-28). It joins the held results and is shortened like any old one.
hint = HumanMessage(content=after_apply_hint)
Expand Down
Loading
Loading