Repository navigation
Conversation
…it fails An incomplete or failed deep enrich in `teamai import` printed 'Deep enrich complete' or logged the error below notice level and exited 0, and `teamai init --http` reported success when the local agent was already initialized and --force was not given, leaving the old endpoint and token in place. Scripts, CI jobs and git hooks read the exit status and carried on as if the commands had worked (Tencent#1500 Part 1, A3-A5). import now reports what a deep enrich missed with the retry command and exits 1 while still publishing the extracted evidence, and a deep-enrich throw is logged at warning level and exits 1, matching the exit-1 precedent of `codebase --deep-enrich` and the `deep-enrich` command. init --http logs the local agent's error and exits 1 without the success line.
|
No findings in the specified diff. The PR description satisfies the testing requirement: it records Review was read-only. I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@kittimzhe Thanks for picking up #1500's Part 1 rows. #1534 (opened earlier) fixes the same rows A3 to A5. We review both in full, the first one ready merges, and the other closes. Several points below are already fixed there, so it's worth reading #1534 and our review on it.
With the built CLI at 70fa38a8 against main (f7e11fe4): an incomplete deep enrich on import --dir, --from-repo and --from-repo-list now exits 1, names what's missing, drops Deep enrich complete and still publishes the evidence. A deep-enrich throw shows as a warning and exits 1. A complete run and init --http --force are unchanged. tsc, lint and the two changed test files pass, and the three new tests fail on main. What blocks approval:
- [P1 blocking] The first
init --httpon a clean machine now fails. In an empty HOME,teamai init --http http://127.0.0.1:9/a --token t1 --scope userprints✖ Local agent init: HTTP local agent is already initialized. Re-run with --force to overwrite.and exits 1. Main exits 0 with✔ teamai initialized (HTTP read-only)!. The legacy backfill inloadLocalAgentConfigreads theconfig.yamlthat init has just written, so the agent looks initialized before it is. The new test misses this because it seeds the local agent with--forcein project scope. Any endpoint works for this check, even an unreachable one. A live server isn't needed. - [P1 blocking] The printed retry fails with
--output.teamai import --dir <src> --output <dir>printsteamai codebase --deep-enrich --project <slug>without the output directory. Run as printed, it givesNo teamwiki foundand exit 1. The--outputrun in your record has the same retry line. - [P1 blocking] In a team repo, the printed retry never publishes.
codebase --deep-enrichwrites the docs into the team clone but doesn't commit or push them, and the nextteamai pushrefuses the dirty clone. This is #1537, and it's the point still open on #1534. Pointing a member at that command makes things worse until #1537 is fixed, so the retry needs to work in a team repo, or name a command that does. - [P2 non-blocking, but it fits this PR] Paths documented as non-blocking now exit 1.
ci extract-mr --mode writeand the teamwiki update inimport --from-mrtreat deep enrich as best effort, and with this change an incomplete enrich makes them exit 1. #1534 keeps them at 0. We found this in the code; it needs an MR API to run. - [P2 non-blocking, but it fits this PR] A refused
init --httphas already written files. By the time it refuses, it has saved the project config and the API key, as the log above shows. Refusing before writing anything leaves the member's previous setup intact.
Non-blocking:
- [P3 nit] The body says
init --httpneeds a live server to test. An unreachable endpoint is enough.
All CI checks are green at this head. The CI review found nothing and judged the record sufficient. We agree on the record, but it ran no code, so it couldn't see the first three points.
@kittimzhe Thanks for this. #1534 fixed the same #1500 rows and was ready first, so it's merged ( |
Closes the remaining Part 1 rows of #1500 (A3–A5), following the
pullexit-1 fix in #1512.Summary
teamai import --dir <src>/--from-repo: an incomplete deep enrich printedDeep enrich completeand exited 0, and a deep-enrich throw (refused symlink, lock, I/O) surfaced only in the debug log — both with✔ … import completeand exit 0 after them.reconcileAndDeepEnrichnow readsdeepEnrich's result: an incomplete run prints a warning naming what is missing plus theteamai codebase --deep-enrich --project <slug>retry command, a throw is logged at warning level, both setprocess.exitCode = 1, and the extracted evidence is still published — matching the exit-1 precedentcodebase --deep-enrich(src/codebase-cmd.ts:165) and thedeep-enrichcommand (src/deep-enrich.ts:853) already set.importwas the odd one out.teamai init --http <url> --token <t>over an existing local agent without--force:initLocalAgentHttpthrows "already initialized. Re-run with --force", but init caught it at debug level and still printed✔ teamai initialized (HTTP read-only)!, so the old endpoint and token stayed while the member read a success line. The catch now logs the local agent's error (which names--force) at error level, setsprocess.exitCode = 1, and returns before the success line — the same shapereconcileHooksForInitabove it already uses. With--forcenothing changes.Hooks keep their own rule: only
import/inita person or script started is affected;--silenthook pulls andrecordGitHookFailureare untouched (#1512 territory).Testing
importLocalCheckoutthrough its command entry,deep-enrich.jsmocked at the module boundary:fails the command when deep enrich leaves docs missing, and still publishes the evidence— warning namesmissing component docs: src, missing architecture.mdand the retry command, noDeep enrich completeline, exit 1,overview.mdpublished (A3).exits 0 and reports completion when deep enrich completes.fails the command when deep enrich throws— warning carries the error and the retry command, exit 1 (A4).init --httpthrough the realinit()entry with the mock team server: a forced init seeds the local agent, a second init without--force(overwrite confirmation answered) logsHTTP local agent is already initializedwith--force, prints no success line, and exits 1; the--forcerun before it succeeds as today (A5).import-codebase.test.ts+http-repo-integration.test.ts(31 tests),tsc --noEmit,oxlint --type-awareclean.docs/guideandskill-datagrepped: no text claims a failed deep enrich or init --http exits 0 or is non-blocking, so no doc changes.Real-CLI verification (
npm run build, then the built CLI)import --dirwith no working AI tool on a strippedPATH, isolatedHOME, after a source change (A3+A4 shape):The evidence is published and the import still completes its report; before this PR the third line read
ℹ Deep enrich complete: svcand the exit status was 0.init --httptwice without--forceneeds a live team server, so it is covered through the realinit()entry over the mock server in the test above rather than a run against a real endpoint.Breaking Changes
None for interactive members: the message and evidence are unchanged, only the exit status and the log level of the failure lines. Scripts that matched on exit 0 from a failed deep enrich or a blocked
init --httpnow see 1, as #1500 specifies.Checklist
Changedentry added