Skip to content

Ichandra2 - #624

Closed
ichandrasharma wants to merge 33 commits into
mainfrom
ichandra2
Closed

ichandrasharma wants to merge 33 commits into
mainfrom
ichandra2

Conversation

@ichandrasharma

Copy link
Copy Markdown
Collaborator

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • Backend tests pass (pytest)
  • Frontend type-checks (tsc --noEmit)
  • Manually tested the user flow

Checklist

  • Code follows the project style (match surrounding patterns)
  • Self-reviewed the diff
  • Comments added for complex logic
  • No new warnings introduced

ichandrasharma and others added 30 commits September 7, 2026 17:21
# Conflicts:
#	AGENT_COORDINATION.md
…nd types as agent requests

fix(next-env): correct import path for route types in TypeScript environment
rush86999 added a commit that referenced this pull request Oct 11, 2026
… a delivered agent answer is never overwritten

Value from PR #624 by @ichandrasharma, adapted: the PR shipped the
behavior change without test updates (6 pinned assertions would have
failed as-is) and without a regression test for the bug it fixed.

Three changes, one contract:

1. Legacy-lane ComputerUse fallback fires ONLY when nothing handled the
   turn. The old condition (not handled OR AGENT_REQUEST) fired after
   the Atom meta-agent had already answered, overwriting its
   final_output with a generic task-ID bubble and spawning a duplicate
   background agent — every tool-plan "agent_request" turn lost its
   answer this way. Atom failing leaves handled=False, so the safety
   net survives (test_explicit_agent_request still pins it, plus a new
   regression test: successful answer preserved, ComputerUse not
   called).

2. Unclassifiable input routes to the general agent instead of a fake
   search. _classify_intent maps CommandType.UNKNOWN (and unmapped
   types) plus _fallback_intent_analysis's keyword-free else-branch to
   AGENT_REQUEST. Rationale: the legacy lane's SEARCH handler returns
   success over an empty store, so the old SEARCH_REQUEST default
   dead-ended in "I found 0 results" for precisely the turns no
   classifier understood. One deadline-bounded Atom run (the legacy
   lane is already sliced by _FEATURE_ROUTING_MAX_SECONDS) instead of a
   template non-answer. R82's scoping stands: genuinely search-
   classified turns still never reach ComputerUse. command_type in the
   fallback dict stays "search" for rule-classified intents and is
   "agent" only when that was actually decided (no consumer reads it;
   kept honest for the _TOOL_PLAN_INTENT_MAP contract).

3. next-env.d.ts: restore the canonical .next/dev/types/routes.d.ts
   reference (established in 2ae66a0, clobbered by snapshot commit
   5449299 which leaked a preview instance's custom distDir
   .next-preview-crosssrc_fix_0929 into the tracked file).

Verified (TESTING=1, backend venv): 31 covpush intent/deadline tests +
39 w115 classify/fallback/route tests green; w89 intent tests identical
to pristine; test_chat_orchestrator.py shows the SAME 11 pre-existing
env-dependent evidence-test failures on pristine origin/main and on
this tree, with one additional pass (the new regression test). Nothing
new fails anywhere.
@medscribeai

Copy link
Copy Markdown

Closing — the value from this PR has been harvested and landed on main in aaa883d (credit @ichandrasharma for all three findings). The PR itself is not being merged as-is because it shipped the behavior change without test updates (6 pinned characterization assertions across 4 covpush suites would have failed) and without a regression test for the bug it fixed.

What landed (adapted + fixed + tested):

  1. ComputerUse fallback no longer overwrites a delivered answer. The old condition (not handled OR AGENT_REQUEST) fired after the Atom meta-agent had already answered, replacing its final_output with a generic task-ID bubble and spawning a duplicate background agent. Now the fallback fires only when nothing handled the turn; the safety net survives an Atom failure. New regression test added (test_successful_agent_answer_is_not_overwritten).

  2. Unclassifiable input routes to the general agent (CommandType.UNKNOWN + unmapped types + the keyword-free fallback else-branch → AGENT_REQUEST). The legacy lane's SEARCH handler returns success over an empty store, so the old SEARCH_REQUEST default dead-ended unclassifiable turns in "I found 0 results". R82's agent-spend scoping stands: genuinely search-classified turns still never reach ComputerUse.

  3. next-env.d.ts restored to the canonical .next/dev/types/routes.d.ts (the committed .next-preview-crosssrc_fix_0929/... path was leaked preview-instance state from snapshot commit 5449299).

Verified: 70+ intent/routing/deadline tests green; failure sets identical to pristine main everywhere else (11 pre-existing env-dependent evidence tests, unrelated). The earlier commits on this branch (owner-dashboard live payload, pdf-worker path, next-env) had already landed on main via other paths — nothing else in the branch carries unique changes.

1 similar comment
@rush86999

Copy link
Copy Markdown
Owner

Closing — the value from this PR has been harvested and landed on main in aaa883d (credit @ichandrasharma for all three findings). The PR itself is not being merged as-is because it shipped the behavior change without test updates (6 pinned characterization assertions across 4 covpush suites would have failed) and without a regression test for the bug it fixed.

What landed (adapted + fixed + tested):

  1. ComputerUse fallback no longer overwrites a delivered answer. The old condition (not handled OR AGENT_REQUEST) fired after the Atom meta-agent had already answered, replacing its final_output with a generic task-ID bubble and spawning a duplicate background agent. Now the fallback fires only when nothing handled the turn; the safety net survives an Atom failure. New regression test added (test_successful_agent_answer_is_not_overwritten).

  2. Unclassifiable input routes to the general agent (CommandType.UNKNOWN + unmapped types + the keyword-free fallback else-branch → AGENT_REQUEST). The legacy lane's SEARCH handler returns success over an empty store, so the old SEARCH_REQUEST default dead-ended unclassifiable turns in "I found 0 results". R82's agent-spend scoping stands: genuinely search-classified turns still never reach ComputerUse.

  3. next-env.d.ts restored to the canonical .next/dev/types/routes.d.ts (the committed .next-preview-crosssrc_fix_0929/... path was leaked preview-instance state from snapshot commit 5449299).

Verified: 70+ intent/routing/deadline tests green; failure sets identical to pristine main everywhere else (11 pre-existing env-dependent evidence tests, unrelated). The earlier commits on this branch (owner-dashboard live payload, pdf-worker path, next-env) had already landed on main via other paths — nothing else in the branch carries unique changes.

@rush86999 rush86999 closed this Oct 11, 2026
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.

3 participants