Skip to content

Decision change during human in loop - #139

Open
ArnabChatterjee20k wants to merge 5 commits into
discord-message-linksfrom
decision-change-during-human-in-loop
Open

Decision change during human in loop#139
ArnabChatterjee20k wants to merge 5 commits into
discord-message-linksfrom
decision-change-during-human-in-loop

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown
Member

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds reply-thread context to intent classification so follow-up decisions can account for earlier Claudear responses while excluding user-authored parent messages from routing prompts.

  • Extends both classifier backends to accept optional conversation context.
  • Adds trust-aware Discord reply-chain assembly for full-answer grounding versus routing.
  • Uses Claudear-only transcripts in watcher and processor intent decisions.
  • Adds coverage for conversation prompting, token stripping, and exclusion of user-authored routing text.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/claudear-engine/src/intent.rs Defines contextual classifier framing and strips chat control tokens from prior conversation text.
crates/claudear-engine/src/processing.rs Refactors reply-chain assembly around explicit trust modes and excludes user-authored turns from routing transcripts.
crates/claudear-engine/src/watcher.rs Supplies Claudear-only reply context when partitioning incoming messages by intent.
crates/claudear-engine/src/agent_classifier.rs Adds optional conversation context to agent-backed classification prompts.
crates/claudear-engine/src/llm_classifier.rs Adds optional sanitized conversation context to local-LLM classification prompts.

Reviews (6): Last reviewed commit: "fix(engine): exclude untrusted user turn..." | Re-trigger Greptile

Comment thread crates/claudear-engine/src/intent.rs Outdated
Comment thread crates/claudear-engine/src/intent.rs
@ArnabChatterjee20k
ArnabChatterjee20k changed the base branch from discord-message-links to main August 11, 2026 06:42
@ArnabChatterjee20k
ArnabChatterjee20k changed the base branch from main to discord-message-links August 11, 2026 06:43
@ArnabChatterjee20k
ArnabChatterjee20k changed the base branch from discord-message-links to main August 11, 2026 06:46
@ArnabChatterjee20k
ArnabChatterjee20k changed the base branch from main to discord-message-links August 11, 2026 06:49
@ArnabChatterjee20k
ArnabChatterjee20k force-pushed the decision-change-during-human-in-loop branch from bf14639 to 651d1fb Compare August 11, 2026 07:31
Comment thread crates/claudear-engine/src/processing.rs
…unction

Callable wherever a Config and tracker are available, so intent
classification can reach the reply-chain transcript before an
IssueProcessor exists. The method now delegates to it.
QA-vs-fix routing judged each message in isolation, so a follow-up in an
ongoing Discord thread ("yes create a pr now") kept classifying as a
question and stayed pinned to the read-only QA lane with no way to
escalate.

classify_intent now takes the prior conversation; both backends frame it
as context and classify the latest message. The watcher's poll-time loop
and the action pipeline assemble the reply chain and pass it in.
Reply-chain text is arbitrary Discord content and now steers QA-vs-fix
routing. A crafted parent message could inject local-model chat control
tokens to forge an assistant turn and force fix/PR handling. Strip any
<|...|> sequence before embedding and frame the transcript as untrusted
context the model must not take instructions from.
Sanitizing control tokens still left natural-language injection: a parent
message telling the model to classify the next message as a fix was
embedded verbatim and could escalate a read-only question into automated
fix/PR handling.

Split the reply-chain transcript by trust. Classification now assembles a
ClaudearOnly transcript (our own answers, which we authored), while answer
grounding keeps the full transcript. The walk still traverses user turns
so upstream Claudear answers stay reachable, but their text never reaches
the routing prompt.
@ArnabChatterjee20k
ArnabChatterjee20k force-pushed the decision-change-during-human-in-loop branch from 651d1fb to db76ec1 Compare August 16, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant